-
Notifications
You must be signed in to change notification settings - Fork 76
add extra domain restriction to transpose scheduler #5884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
!test --diff |
|
Review updated until commit cbeb32d Description
|
| Relevant files | |||
|---|---|---|---|
| Bug fix |
| ||
| Tests |
|
PR Reviewer Guide
Here are some key observations to aid the review process:
| 🧪 PR contains tests |
| 🔒 No security concerns identified |
| ⚡ Recommended focus areas for review |
Logic validation
|
|
!test |
|
!test |
|
!test |
Greptile OverviewGreptile SummaryAdds logic to Key changes:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Scheduler as Transpose Scheduler
participant TDM as TransposeDomainMap
participant CAMap as ComputeAtMap
Scheduler->>TDM: hasAtLeastTwoValidGroups(fusion)
TDM->>TDM: groupInputsOutputsByInnerDim()
alt Less than 2 groups
TDM-->>Scheduler: false (reject transpose)
end
TDM->>TDM: findReferenceFor(group1)
TDM->>TDM: findReferenceFor(group2)
alt Either reference is null
TDM-->>Scheduler: false (reject transpose)
end
TDM->>TDM: getMappedAllocDimIn(ref1, innermost2)
alt mapped_id is null
TDM-->>Scheduler: false (reject transpose)
end
Note over TDM: NEW CHECK ADDED IN THIS PR
TDM->>TDM: Get allocation domains for ref1 and ref2
TDM->>CAMap: Check if all domains are mapped (PERMISSIVE)
alt All domains mapped
TDM->>TDM: Check for broadcast dimensions
alt Has broadcast
Note over TDM: Groups caused by broadcast,<br/>not transpose
TDM-->>Scheduler: false (use pointwise instead)
else No broadcast
TDM->>TDM: ERROR - all_mapped implies broadcast
end
else Some domains not mapped
Note over TDM: Groups caused by permutation<br/>(real transpose case)
TDM-->>Scheduler: true (use transpose scheduler)
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
csrc/scheduler/tools/domain_map.cpp
Outdated
| return false; | ||
| } | ||
|
|
||
| // For grouping caused by permutation, the corresponding loop domains should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allocation domains instead of loop domains?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, revised.
csrc/scheduler/tools/domain_map.cpp
Outdated
| } | ||
|
|
||
| // For grouping caused by permutation, the corresponding loop domains should | ||
| // not be all mapped to each other. If they are, it means the two groups are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an example pattern here as a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added.
// For example, in TransposeTest.NoTransposeMaverick17B, two inputs
// are tv0[i0, i1] and tv1[i2, b3] where i0/i2 and i1/b3 are mapped to each
// other. However, tv0 and tv1 are in two different groups because of the
// broadcast. In this case, we should use the pointwise scheduler instead of
// the transpose scheduler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
To solve issue #5883 for better performance