Skip to content

perf(rccl): batch peer polling and prefetch sends in the DDA LL one-shot AllReduce - #14880

Merged
pvallem merged 2 commits into
developfrom
users/saverine/allreduce-ll-oneshot-batched-poll
Nov 4, 2026
Merged

pvallem merged 2 commits into
developfrom
users/saverine/allreduce-ll-oneshot-batched-poll

Conversation

@ankith117

Copy link
Copy Markdown
Contributor

Motivation

The DDA LL one-shot AllReduce reads a cold send buffer after its epoch barrier, and waits on each peer line in turn, so the round trips serialize.

Technical Details

  • On gfx1250, the one-shot prefetches its first send packets into L2 before the epoch barrier (ddaLLPrefetchSend).
  • Phase 2 polls each batch of peer lines (up to 8) under one load wait (ddaLLWaitLineFlagsBatched) instead of one line at a time. With 5 or more lines in a batch, a waiting lane spins on one stale line between sweeps.
  • Abort stays sticky: an aborted thread skips its recvbuff write and still advances the epoch.
  • New single-GPU device tests play the peers from host memory; the ReduceScatter LL test now shares that helper (DdaLLHostPeers.hpp).
Diff
Functional code +165 / -20
Tests +374 / -49

Issue Tracking

N/A

Test Plan

  • New DdaAllReduceFabricLL.* device tests, in rccl-UnitTests (b128 loads) and rccl-UnitTestsFixtures (dword loads): 4 and 8 ranks compile-time, 2 and 6 ranks runtime, late peer, torn line, abort while polling.
  • Existing DdaReduceScatterFabricLL.* tests.

Test Result

Submission Checklist

…hot AllReduce

The one-shot read a cold send buffer after its epoch barrier and waited on
each peer line in turn, so the round trips serialized. Prefetch the send
packets into L2 before the barrier on gfx1250, and poll each batch of peer
lines under one load wait.
@ankith117
ankith117 requested review from a team November 3, 2026 00:35
@therock-pr-bot

therock-pr-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
📝 PR Description ❌ Fail Error: PR description must reference a JIRA ID, ISSUE ID, or a GitHub closing keyword.
Expected: include a JIRA ID / ISSUE ID line (separator : or -, or omitted; value may be a JIRA key, a number with/without #, or a link), OR a closing keyword + issue reference. Accepted examples:
• JIRA ID : TESTAUTO-6039
• JIRA ID - #330
• JIRA ID #330
• JIRA ID (on separate line)
ROCM-25757
• ISSUE ID : TESTUTO-3334
• ISSUE ID #3334
• ISSUE ID - TESTAUTO-3433
• ISSUE ID (on separate line)
AIRUNTIME-2352
• ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
• Closes #10
• Fixes octo-org/octo-repo#100
• Resolves: #123
• #123
• https://github.com/<org_name>/<repo_name>/issues/123
Current: no valid JIRA/ISSUE/closing-keyword reference found
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ⏳ Pending ⏳ Still running…
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

⚠️ 1 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ PR Description

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@amd-argus

amd-argus Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@cppccppccppc @sunguobao PTAL

@amd-argus
amd-argus Bot requested review from dlamd1dai and nusislam November 3, 2026 01:01

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGUS

Findings

5 more finding(s), not posted inline
  • projects/rccl/src/algorithms/dda/device/CollCommon.h:482 (Low) line[__builtin_ctz(mask)] indexes line[] with a runtime value, which CollCommon.h:322-323 says puts the array in scratch; pick first with an unrolled select instead.
  • projects/rccl/src/algorithms/dda/device/CollCommon.h:475 (Low) Follow-up: ddaLLWaitLineFlagsBatched and ddaLLPrefetchSend duplicate the inline poll and prefetch in reduce_scatter_dda_fabric_ll.h (:85-93, :138-193), which already use a different batch size (4 vs 8); the ReduceScatter path could call the shared helpers.
  • projects/rccl/test/device/DdaAllReduceFabricLLTests.cpp:127 (Low) bitsOf, phase1Done, recv, expectEpochAdvanced and the phase-1 wait loop copy the ReduceScatter test's helpers; they could move into DdaLLHostPeers.hpp.
  • projects/rccl/test/device/DdaReduceScatterFabricLLTests.cpp:10 (Nit) #include &lt;atomic&gt; is unused now that the release fences live in DdaLLHostPeers.hpp; drop it. #include &lt;atomic&gt; has no remaining user now that the release fences live in DdaLLHostPeers.hpp, so it can be dropped.
  • projects/rccl/test/CMakeLists.txt:314 (Nit) This comment now heads two files; change 'it runs' to 'they run'.

Bottom line: Worth settling before approval: DdaAllReduceFabricLL.* is missing from both test_categories yaml files, and no test runs more than 8 ranks, so the multi-batch fold and the prefetch bound go unchecked.

Comment @argus review to re-run, or @argus re-review after pushing.

Comment thread projects/rccl/test/CMakeLists.txt Resolved
@github-actions

This comment was marked as off-topic.

@github-actions

This comment was marked as off-topic.

…catter poll barriers

The DDA LL one-shot AllReduce inlines its batched poll and fold, hard-codes the prefetch group as 16 lanes, pins each
polled word with inline asm, indexes the line array with a runtime value, and its device tests are not in the test
categories.

Fix: move the poll and rank-order fold into ddaLLFoldRanksInOrder next to the AllReduce kernel, derive the prefetch
group from the 128 B line and 8 B packet sizes, load each sweep into a v4u array between the same asm memory barriers
the ReduceScatter LL kernel uses, pick the first polled line with an unrolled select, and list DdaAllReduceFabricLL.*
in test_categories.yaml and test_categories_fixtures.yaml.
@github-actions

This comment was marked as off-topic.

@github-actions

This comment was marked as off-topic.

@amd-argus amd-argus Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGUS

Bottom line: Nothing new worth raising; still open from earlier: DdaAllReduceFabricLLTests.cpp:29 and 1 more. Worth clearing before approval.

Comment @argus review to re-run, or @argus re-review after pushing.

@alex-breslow-amd alex-breslow-amd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks improved.

@pvallem
pvallem merged commit f59fd15 into develop Nov 4, 2026
63 of 66 checks passed
@pvallem
pvallem deleted the users/saverine/allreduce-ll-oneshot-batched-poll branch November 4, 2026 07:44
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants