Skip to content

Commit 730c47c

Browse files
mawad-amdclaude
andcommitted
Fix RS graph capture test reference — use all_reduce not reduce_scatter_tensor
iris RS takes (M,N) input and (M,N) output (same shape). Each rank reduces its assigned tiles from all peers. The torch equivalent is all_reduce, not reduce_scatter_tensor (which has different shape semantics: ws*M input → M output). Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
1 parent 084847e commit 730c47c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/ccl/test_graph_capture.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ def collective(out, inp):
9696
ctx.ccl.reduce_scatter(out, inp)
9797

9898
def reference(out, inp):
99-
big = inp.expand(ws, -1).contiguous().view(ws * M, N)
100-
dist.reduce_scatter_tensor(out, big)
99+
# iris RS: all ranks have same-shaped (M,N) input, each rank reduces
100+
# its assigned tiles. Equivalent to all_reduce (sum all inputs).
101+
out.copy_(inp)
102+
dist.all_reduce(out)
101103

102104
_graph_capture_test(ctx, collective, reference, (M, N), (M, N))
103105

0 commit comments

Comments
 (0)