Conversation
|
!test |
|
Review updated until commit 807a8e6 Description
|
| Relevant files | |||
|---|---|---|---|
| Bug fix |
| ||
| Documentation |
| ||
| Tests |
|
PR Reviewer Guide
Here are some key observations to aid the review process:
| 🧪 PR contains tests |
| ⚡ Recommended focus areas for review |
Logic Flow Changes
if (!haveDifferentShardings(producer, consumer, {pt})) at line 348-350 is a key change that affects the control flow. This should be carefully validated to ensure it doesn't break existing functionality for 1D meshes while properly handling multi-dimensional cases. |
|
!test |
1 similar comment
|
!test |
Greptile SummaryThis PR fixes
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["getCommunicationInfo(Expr* e)"] --> B["Loop over kParallelTypeDIDs\n(DIDx, DIDy, DIDz)"]
B --> C["getCommunicationInfoForParallelType\n(producer, consumer, pt)"]
C --> D{"haveDifferentShardings\n(producer, consumer, {pt})"}
D -- "No sharding change" --> E["return nullopt\n(skip this PT)"]
D -- "Has sharding change" --> F{"consumer def type?"}
F -- "LoadStoreOp" --> G{"p_loop_id / c_loop_id?"}
G -- "both null\n(different meshes)" --> H["Broadcast"]
G -- "p only" --> I{"same mesh?"}
I -- "yes" --> J["Allgather"]
I -- "no" --> K["Gather"]
G -- "c only" --> L["Scatter"]
G -- "both present" --> M{"same logical ID?"}
M -- "yes" --> N["SendRecv"]
M -- "no" --> O["AllToAll"]
F -- "ReductionOp/SqueezeOp" --> P{"c_loop_id?"}
P -- "null" --> Q{"same mesh?"}
Q -- "yes" --> R["Allreduce"]
Q -- "no" --> S["Reduce"]
P -- "present" --> T["ReduceScatter"]
Last reviewed commit: 807a8e6 |
Additional Comments (1)
The new code in This means |
|
!test |
Additional Comments (1)
|
|
!test |
| // x: [iDIDy{2}, iDIDx{2}] on mesh [[0, 1], [2, 3]] | ||
| // y = set(x): [iDIDy{2}, i{2}] on mesh [[0], [2]] | ||
| // ``` | ||
| // should be treated as non-resharding on DIDy. |
There was a problem hiding this comment.
Instead of device mesh, we should be comparing the slice corresponding to the parallel types here.
There was a problem hiding this comment.
Does it work?
x: [iDIDy{2}, iDIDx{2}] on mesh [[0, 1], [2, 3]]
y = set(x): [iDIDy{2}, i{2}] on mesh [[0], [3]]
is also non-resharding.
Fixes #4604