Conversation
|
!test |
|
Review updated until commit 4875590 Description
|
| Relevant files | |||||
|---|---|---|---|---|---|
| Enhancement |
|
PR Reviewer Guide
Here are some key observations to aid the review process:
| 🧪 PR contains tests |
| ⚡ Recommended focus areas for review |
Incomplete Documentation
|
Greptile OverviewGreptile SummaryThis PR simplifies the alias analysis logic by ensuring all tensors with allocations are marked as Key changes:
Design rationale: Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Pass as MarkAliasesPreparePass
participant Fusion as Fusion
participant TV as TensorView
participant Analysis as AliasAnalysisResult
participant Finder as AliasFinder
Pass->>Fusion: runPass(fusion)
Pass->>Fusion: allTvs()
Fusion-->>Pass: all TensorViews
loop For each TensorView with allocation
Pass->>TV: hasAllocation()
TV-->>Pass: true
Pass->>TV: setMemoryType(Global)
end
Pass->>Analysis: findAliases(fusion, kUndetermined)
Analysis->>Finder: create AliasFinder
loop For each expr in fusion
Finder->>Finder: dispatch(expr)
Finder->>Finder: okToRelayout(tv, layout, kUndetermined)
alt tv is not Global memory
Finder-->>Finder: return true (always allow)
else tv is Global memory
alt tv has no allocation
Finder-->>Finder: return true (can relayout)
else tv has allocation
Finder->>Finder: check layout compliance
Finder-->>Finder: return isCompliant
end
end
end
Analysis->>Analysis: finalize()
Analysis-->>Pass: alias analysis result
|
|
|
|
!test |
| // Alternatively, we could hold as a contract that all TVs pre | ||
| // segmentation are global. If you prefer this, I can try it in a separate | ||
| // PR. This sounds natural to me because without scheduling every TV is | ||
| // indeed stored globally. |
There was a problem hiding this comment.
I think I agree with you, since we have clearMemorySpace that is used by every scheduler:
Fuser/csrc/scheduler/utils.cpp
Lines 1280 to 1289 in 5ce52e8
FIXME: comments