Repository navigation
fix(RCCL):Improve DDA LL reduce-scatter performance by increasing communication overlap. - #13503
JhaShweta1 wants to merge 8 commits into
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
@cppccppccppc @sunguobao PTAL |
There was a problem hiding this comment.
ARGUS
Findings
5 more finding(s), not posted inline
projects/rccl/test/DdaFabricEligibilityTests.cpp:1548(Low) ReduceScatterLL_BankOneMatchesSharedScratchMidpoint only re-checks the ddaLLRsBankOffsetPkts formula and would pass with the launcher fix revertedprojects/rccl/test/DdaFabricEligibilityTests.cpp:1546(Low) EXPECT_LT(packedBank, bank) cannot fail at the derived 256/512 MiB scratch; the RS LL scratch boundary at .cu:127 is untestedprojects/rccl/src/algorithms/dda/reduce_scatter/reduce_scatter_dda_fabric_ll.h:171(Low) Phase-2 builtin branch reimplements ddaLLLoadLineB128 inline and recomputes peer/src in each loopprojects/rccl/src/algorithms/dda/reduce_scatter/reduce_scatter_dda_fabric_ll.h:58(Low) kDdaLLRsPeerBatch adds a third copy of the peer-batch constant that all_reduce_dda_ll_twoshot.h:50 has a TODO to shareprojects/rccl/src/algorithms/dda/reduce_scatter/dda_reduce_scatter_fabric_ll.cu:29(Low) ddaLLRsScratchSize comment calls 2*ddaLLRsBankBytes the footprint, but it is now the minimum scratch for bank 1 at the midpoint
Bottom line: LGTM.
Comment @argus review to re-run, or @argus re-review after pushing.
srirajpaul
left a comment
There was a problem hiding this comment.
is the performance data available ?
Gather each peer shard into registers before issuing the stores, matching the two-shot all-reduce, so the remote writes stay in flight together. Co-authored-by: Cursor <cursoragent@cursor.com>
…banks Issue each peer group's reads before testing flags, and place bank 1 at the shared scratch midpoint so reduce-scatter cannot overwrite another LL tier. Co-authored-by: Cursor <cursoragent@cursor.com>
6a94138 to
3603a0a
Compare
Share the peer-batch width and drop repeated layout comments from review. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
ARGUS
Bottom line: Worth settling before approval: ReduceScatterLL_ScratchBanksFit only probes scratch = 2 * bankBytes, where the old and new bank-1 offsets coincide, so the bank move this PR makes is not pinned by any test.
Comment @argus review to re-run, or @argus re-review after pushing.
16- and 32-GPU sweeps show LL128 ahead of LL from 512 KiB per rank and ahead of ring through 1 MiB per rank. The old 512 KiB LL128 cap sat inside the 1 MiB LL window, so LL128 never ran. Co-authored-by: Cursor <cursoragent@cursor.com>
| // Phase-2 reads in flight at once. Each peer keeps two data words and two | ||
| // flags, so 4 stays in registers; 8 matches the send batch but costs twice | ||
| // the temporary values. | ||
| constexpr int kDdaLLRsRecvBatch = 4; |
There was a problem hiding this comment.
Did you try a receive batch of 8? At 8 ranks it costs about 14 VGPRs, with no spills and no occupancy limit. All 7 polls would then be in flight at once.
There was a problem hiding this comment.
Tried a receive batch of 8 on a DPX node (8 gfx1250 ranks, one MPI process per GPU, confirmed DDA fabric LL). Across the LL window, the 8-rank float geomean bus bandwidth was +1.3% and bf16 +0.5%, both inside run-to-run noise. The 4-rank float sweep was −2.5%, since only 3 remote peers exist and the larger batch adds no extra polls. Leaving kDdaLLRsRecvBatch at 4.
| if (r < nRanks) { | ||
| const int peer = (selfRank + r) % nRanks; | ||
| const uint32_t* src = reinterpret_cast<const uint32_t*>(myBase + (size_t)peer * slot + pk); | ||
| while (f0[i] != flag || f1[i] != flag) { |
There was a problem hiding this comment.
This loop retries late peers one at a time. Could we re-poll all the stale lines in the batch together, so each retry round is a single round trip?
There was a problem hiding this comment.
The first read of the batch is already issued together, and a line whose flags match is kept. The one-at-a-time loop only runs for a miss. Re-polling stale lines together would need the same open-coded global_load_b128 plus memory clobber as the first read, because ddaLLLoadLineB128 starts with a compiler barrier and would split the retries apart again. The batch-8 sweep already showed that extra in-flight polls do not move the LL window, so the retry is left one peer at a time.
| const int r = base + i; | ||
| if (r < nRanks) { | ||
| const int peer = (selfRank + r) % nRanks; | ||
| LLPacket16* dst = reinterpret_cast<LLPacket16*>(peerScratch[peer]) + bankOffsetPkts + (size_t)selfRank * slot; |
There was a problem hiding this comment.
The memory clobber in ddaLLStoreLineB128 forces peerScratch[peer] to be reloaded before every store. Could we compute the dst pointers once, outside the pk loop?
There was a problem hiding this comment.
The reload is there: on gfx1250 the float 8-rank kernel does an s_load of peerScratch[peer] before each store. A cache computed once outside the packet loop was compiled back into those loads. Pinning the bases in scalar registers removed the reloads, with scratch still 0 and the float 8-rank kernel moving from 24 to 32 VGPRs. On the DDA LL window that was slower: 8-rank float geomean −1.7%, bf16 −3.0%, and 4-rank float −4.3% at every size. Leaving the per-store reload.
The 16 MiB LL total covered the 2 MiB LL128 window, so 4-GPU auto stayed on LL through 1 MiB per rank. LL128 is 1.5-1.9x faster from 512 KiB per rank. Co-authored-by: Cursor <cursoragent@cursor.com>
At two banks the packed offset and bankSize agree, so the existing eligibility test cannot tell them apart. Co-authored-by: Cursor <cursoragent@cursor.com>
…_ll_rs Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # projects/rccl/src/algorithms/dda/reduce_scatter/dda_reduce_scatter_fabric_ll.cu # projects/rccl/src/algorithms/dda/reduce_scatter/reduce_scatter_dda_fabric_ll.h # projects/rccl/test/DdaFabricEligibilityTests.cpp
The launcher passes bankSize before DdaKernelParams, so the microtest still checking nine arguments fails. Co-authored-by: Cursor <cursoragent@cursor.com>
Motivation
Improve DDA LL reduce-scatter performance by increasing communication overlap.
Technical Details
Issue Tracking
JIRA ID: AICOMRCCL-2472
Test Plan
Test Result
Submission Checklist