Skip to content

fix(rccl): use MI450 cooperative 128-bit builtins and explicit vector loads/stores in LL128 - #10666

Open
alex-breslow-amd wants to merge 9 commits into
developfrom
users/abreslow/ll128_cleanup
Open

alex-breslow-amd wants to merge 9 commits into
developfrom
users/abreslow/ll128_cleanup

Conversation

@alex-breslow-amd

@alex-breslow-amd alex-breslow-amd commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • On gfx1250 (MI450), the LL128 comm FIFO uses the cooperative 128-bit atomics (__builtin_amdgcn_cooperative_atomic_load_8x16B / _store_8x16B) at system scope, so each 8-lane group moves one non-tearing 128-byte line. They live in the new load128Fifo / store128Fifo helpers in prims_ll128.h, which recvReduceSendCopy executes on every lane.
  • User-buffer accesses (load128, store128, load128NT) stay per-thread, because their callers skip flag lanes and do not run whole groups. They now issue one explicit 16-byte vector operation instead of two 8-byte operations that relied on the compiler fusing them. load128 uses system scope.
  • rccl_ptr.h adds v4i / v4i_gptr (the cooperative builtins take signed vectors), a shared rcclB128 pun, RCCL_HAVE_COOPERATIVE_ATOMIC_BUILTINS, and rcclIdentity.
  • -DDWORDX4_INTRINSICS=OFF also disables the cooperative builtins. Without them, the FIFO falls back to the system-scope global_load_b128 / global_store_b128 where available, otherwise the previous nontemporal load and plain store.
  • -DREPORT_COOPERATIVE_ATOMICS=ON (default OFF) adds a build target that prints, per GPU target, whether the cooperative builtins are selected.

ROCm 10.1 compiler workaround (rcclIdentity)

The ROCm 10.1 LLVM lowers cooperative_atomic_load_8x16B to an i128 ATOMIC_LOAD whose computed known bits have the wrong width. Masking the result crashes instruction selection (APInt::andAssignSlowCase) or silently miscompiles the mask. Upstream LLVM fixes this (memVT = MVT::getVT(CI.getType())).

Every cooperative load result, including DDA's ddaLL128LoadAtomic16B, passes through rcclIdentity. On ROCM_VERSION < 100200 it calls llvm.amdgcn.softwqm through an asm label (no inline asm). Outside WQM that lowers to a copy, so it costs no instructions, but the SelectionDAG cannot see through it. On ROCm 10.2 and later it is a plain identity.

JIRA ID: ROCM-31751

Test plan

  • Clean full Release (-O3) and Debug (-O1) builds of all device kernels for gfx1250 with ROCm 10.1
  • LL128 kernel built with -DCOOPERATIVE_ATOMIC_INTRINSICS_FORCE_OFF compiles and still emits system-scope global_store_b128 for the FIFO
  • -DREPORT_COOPERATIVE_ATOMICS=ON reports on for gfx1250 and off for gfx942; gfx942:xnack+;gfx942:xnack- produce one check
  • New LlFifoSysScopeDeviceTest.Gfx1250SelectsCooperative and CooperativeLineRoundtrip compile for gfx942 and gfx1250; CooperativeLineRoundtrip fails to compile on ROCm 10.1 if rcclIdentity is removed
  • LlFifoSysScopeDeviceTest.* on MI450
  • LL128 collectives on MI450, including LlFifoSysScope.SiblingBroadcastSlotReuse_LL128 on DPX siblings
  • LL128 collectives on gfx942 / gfx950

@therock-pr-bot

therock-pr-bot Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

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

🙋 Wish to Override Policy?

@therock-pr-bot

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.

Copilot AI 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.

Pull request overview

This PR updates RCCL LL128 128-bit memory operations for gfx1250/MI450 and fallback architectures.

Changes:

  • Adds vector pointer types and device synchronization scope definitions.
  • Adds gfx1250 cooperative atomic load/store paths.
  • Replaces paired 64-bit accesses with explicit vector operations.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Summary Findings
projects/rccl/src/include/nccl_device/rccl_ptr.h Adds vector types and sync-scope definitions. None.
projects/rccl/src/device/prims_ll128.h Uses explicit vector non-temporal loads. None.
projects/rccl/src/device/op128.h Implements cooperative and vector-based 128-bit operations. Two critical findings: cooperative load/store calls may lack full 8-lane participation. One moderate finding: the fallback load uses device scope instead of the required system scope.
Suppressed comments (1)

projects/rccl/src/device/op128.h:22

  • This adds the gfx1250 cooperative path, but the current device tests do not execute an LL128 collective with registered user buffers: TestOp128 only round-trips one direct load128/store128 pair, and LL128RegVariantKernel_test checks function-table IDs rather than memory behavior. Add a gfx1250 multi-rank registered-buffer LL128 data round-trip (including the cooperative load/store path) before relying on this correctness-critical change.
#if __has_builtin(__builtin_amdgcn_cooperative_atomic_load_8x16B) && defined(__gfx1250__)
  u.vi = __builtin_amdgcn_cooperative_atomic_load_8x16B((v4i_gptr)ptr, __ATOMIC_RELAXED, RCCL_DEVICE_SYNCSCOPE);

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread projects/rccl/src/device/op128.h Resolved
Comment thread projects/rccl/src/device/op128.h Resolved
Comment thread projects/rccl/src/device/op128.h Resolved
Comment thread projects/rccl/src/device/op128.h Outdated
BytePack<16> ans; \
ans.u64[0] = *((uint64_t*)addr); \
ans.u64[1] = *((uint64_t*)addr + 1); \
ans.v4u = *((v4u_gptr)addr); \

@alex-breslow-amd alex-breslow-amd Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This change is probably a performance win. I need to check if it now outputs global instead of flat instructions. Previously, that helped a fair bit. The compiler can often lose track of whether a pointer is to global memory or LDS. In that ambiguous case, it emits a flat vector memory instruction, which works on both. However, that can incur a performance hit since the hardware needs to do extra work. I'll have to take a look at the assembly to see if even this is working. Previously, I had to get the address of ans.v4u, cast it to an address_space(1) pointer and then dereference it again. Gross, but you get the idea.

Comment thread projects/rccl/src/device/op128.h Resolved
@alex-breslow-amd

Copy link
Copy Markdown
Contributor Author

Stack: #10670 is stacked on this PR.

Merge order: #10666 → then #10670 (GitHub will retarget #10670 to `develop` after this lands).

@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

1 finding(s) that fall outside the diff and could not be anchored to a line
  • projects/rccl/CHANGELOG.md:24 (Nit) No CHANGELOG entry for the gfx1250 LL128 load/store change; the unreleased 2.30.7 section has none and the file carries device-internal entries at this granularity.

Bottom line: Worth settling before approval: the new gfx1250 guard at op128.h:21 skips DWORDX4_INTRINSICS_FORCE_OFF, so -DDWORDX4_INTRINSICS=OFF no longer disables 128-bit builtins there. Everything else I found is Low or Nit.

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

Comment thread projects/rccl/src/device/op128.h Resolved
Comment thread projects/rccl/src/device/op128.h Resolved
Comment thread projects/rccl/src/device/op128.h Resolved
@alex-breslow-amd
alex-breslow-amd removed this pull request from stack #10671 September 24, 2026 18:58
@alex-breslow-amd
alex-breslow-amd force-pushed the users/abreslow/ll128_cleanup branch from 644ff87 to b6b6819 Compare October 1, 2026 00:04

@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: Worth settling before approval: -DDWORDX4_INTRINSICS=OFF still does not disable the new cooperative branch at op128.h:21, because COOPERATIVE_ATOMIC_INTRINSICS_FORCE_OFF (rccl_ptr.h:56) is defined nowhere in the build.

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

Comment thread projects/rccl/src/device/prims_ll128.h Resolved
@lfmeadow

lfmeadow commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

AI review of this PR (particularly the review of cooperative atomics) says that the cooperative atomics aren't needed where they are used, and are not used where they are needed. They should be used in recvReduceSendCopy (in prims_ll128.h) in place of load128NT and store128Fifo.
You can see an example of this in algorithms/dda/device/CollCommon_ll128.h .
You don't need the cooperative atomics for user buffers or network unpacking, which is where your changes above are.

I'll admit I haven't studied the code yet myself, but the analysis seems correct.

Comment thread projects/rccl/src/device/op128.h Resolved
Comment thread projects/rccl/src/device/prims_ll128.h Resolved
Comment thread projects/rccl/src/device/op128.h Resolved
Comment thread projects/rccl/src/device/op128.h Resolved
@alex-breslow-amd

Copy link
Copy Markdown
Contributor Author

AI review of this PR (particularly the review of cooperative atomics) says that the cooperative atomics aren't needed where they are used, and are not used where they are needed. They should be used in recvReduceSendCopy (in prims_ll128.h) in place of load128NT and store128Fifo. You can see an example of this in algorithms/dda/device/CollCommon_ll128.h . You don't need the cooperative atomics for user buffers or network unpacking, which is where your changes above are.

I'll admit I haven't studied the code yet myself, but the analysis seems correct.

Yup, I messed up. :)

@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

1 finding(s) that could not be posted as inline comments
  • projects/rccl/src/device/prims_ll128.h:598 (Low) skip_fence's stated justification names global_store_b128, which is no longer the FIFO store emitted on gfx1250 skip_fence at prims_ll128.h:596 is gated on RCCL_HAVE_GLOBAL_DWORDX4_BUILTINS, and the comment at prims_ll128.h:598 justifies the cheap fence by the stores being system-scope global_store_b128, but on gfx1250 the FIFO store is now cooperative_atomic_store_8x16B. Those lines sit outside this diff, so worth a follow-up rather than a change here. Please check.

Bottom line: Worth settling before approval: the inline asm in load128Fifo and store128Fifo (prims_ll128.h:48, :74) has write-only outputs under an empty template, so neither one actually moves its value.

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

Comment thread projects/rccl/src/device/prims_ll128.h Resolved
Comment thread projects/rccl/src/device/prims_ll128.h Resolved
Comment thread projects/rccl/src/device/prims_ll128.h Resolved
Comment thread projects/rccl/src/device/prims_ll128.h Resolved
typedef __attribute__((address_space(1))) v4i* v4i_gptr;

// One 16-byte pun for those two vector types and a pair of uint64 words.
union alignas(16) rcclB128 {

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.

Low

rcclB128 has no uint32_t u32[4], so the 32-bit-word puns at prims_ll.h:95, algorithms/dda/device/CollCommon.h:261 and nccl_device/impl/ll_a2a__funcs.h:18 cannot adopt it. Those files are outside this PR, so just noting it once: adding the member later would let the consolidation finish.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed. I'm leaving this for the follow-up that consolidates the 128-bit puns (prims_ll.h, DDA) onto rcclB128, to keep this PR scoped to LL128.

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

Copy link
Copy Markdown
Contributor

This pull request has been inactive for 25 days and will be marked as stale.

If you would like to keep this PR open, please:

  • Add new commits
  • Add a comment explaining why it should remain open

This PR will be automatically closed in 5 days if no further activity occurs.

@github-actions github-actions Bot added the Stale PR has no activity for 25+ days label Oct 27, 2026
rcclB128 u;
// See rcclIdentity in rccl_ptr.h.
u.vi = rcclIdentity(
__builtin_amdgcn_cooperative_atomic_load_8x16B((v4i_gptr)ptr, __ATOMIC_RELAXED, RCCL_SYSTEM_SYNCSCOPE));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried a bunch of simpler things here, but defining this rcclIdentity function was the only thing that worked and didn't emit additional instructions.

@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: Worth settling before approval: no test distinguishes the gfx1250 cooperative FIFO load/store from the system-scope b128 fallback, so a revert of load128Fifo/store128Fifo would pass unnoticed.

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

rcclB128 u;
// See rcclIdentity in rccl_ptr.h.
u.vi = rcclIdentity(
__builtin_amdgcn_cooperative_atomic_load_8x16B((v4i_gptr)ptr, __ATOMIC_RELAXED, RCCL_SYSTEM_SYNCSCOPE));

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.

Medium

Medium

load128Fifo/store128Fifo move gfx1250 LL128 from the system-scope b128 to the cooperative builtin. LlFifoSysScope.SiblingBroadcastSlotReuse_LL128 passes on either branch, and it skips outright without DPX siblings (LlFifoSysScopeTests.cpp:238). Could a test pin the selected path, for example a single-GPU 8-lane cooperative round-trip kernel built without DWORDX4_INTRINSICS_FORCE_OFF?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added in 2dac0b5:

  • LlFifoSysScopeDeviceTest.Gfx1250SelectsCooperative checks in the device pass that RCCL_HAVE_COOPERATIVE_ATOMIC_BUILTINS is 1 on gfx1250 unless the builtins are forced off, and 0 elsewhere.
  • LlFifoSysScopeDeviceTest.CooperativeLineRoundtrip is a single-GPU cooperative store/load round trip over whole waves (each 8-lane group is one 128-byte line). It also reloads and masks the lines in a second kernel, which crashes ROCm 10.1 instruction selection if rcclIdentity is removed.

Both compile for gfx942 and gfx1250. They have not run on MI450 yet, so I'm leaving this open until they do.

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.

Resolved by 813afbc39a.

// to a copy, but the SelectionDAG cannot see through it.
#if ROCM_VERSION < 100200
extern "C" __device__ __attribute__((const, noconvergent)) v4i rcclSoftWqmV4i(v4i)
__asm("llvm.amdgcn.softwqm.v4i32");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ordinarily this would be unsafe. However, we've clamped the compiler version to one where this LLVM IR exists.

@alex-breslow-amd

Copy link
Copy Markdown
Contributor Author

Re the outside-diff skip_fence finding: the comment is updated in d2d2e95. It now says the cheap post-peer fence requires system-scope FIFO stores, which are global_store_b128 or, on gfx1250, the cooperative 8x16B store.

@amd-argus

amd-argus Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

@cppccppccppc @sunguobao PTAL

@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: Worth settling before approval: the new cooperative tests build in rccl-UnitTestsFixtures under DWORDX4_INTRINSICS_FORCE_OFF, so they never compile the 8x16B builtins or rcclIdentity.

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

@github-actions

Copy link
Copy Markdown
Contributor

pr-rocm-systems-10666-oci-rccl-pr-build

Builds

Stack Component Version Commit Status Build time
pr-10666_rccl-backtrace_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-backtrace_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-backtrace_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-backtrace_rocm-10.1-ga rccl-pr-10666-backtrace 2dac0b5 2dac0b5 built 108s
pr-10666_rccl-backtrace_rocm-10.1-ga rccl_gtest-pr-10666 2dac0b5 2dac0b5 built
pr-10666_rccl-debug_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-debug_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-debug_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-debug_rocm-10.1-ga rccl-pr-10666 2dac0b5 2dac0b5 built 86s
pr-10666_rccl-debug_rocm-10.1-ga rccl_gtest-pr-10666-debug 2dac0b5 2dac0b5 built 180s
pr-10666_rccl-perf_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-perf_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-perf_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-perf_rocm-10.1-ga rccl-pr-10666 2dac0b5 2dac0b5 cached
pr-10666_rccl-perf_rocm-10.1-ga rccl-tests-develop-perf develop ea604d4 built 12s
pr-10666_rccl-perf_rocm-10.2-latest gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-perf_rocm-10.2-latest rocm-10.2-latest 10.2.0rc0 10.2.0rc0 built 69s
pr-10666_rccl-perf_rocm-10.2-latest openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-perf_rocm-10.2-latest rccl-pr-10666 2dac0b5 2dac0b5 built 82s
pr-10666_rccl-perf_rocm-10.2-latest rccl-tests-develop-perf develop ea604d4 built 13s
pr-10666_rccl_rocm-7.0.2 gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl_rocm-7.0.2 rocm-7.0.2 7.0.2 7.0.2 cached
pr-10666_rccl_rocm-7.0.2 openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl_rocm-7.0.2 rccl-pr-10666 2dac0b5 2dac0b5 built 109s
pr-10666_rccl_rocm-7.0.2 rccl_gtest-pr-10666 2dac0b5 2dac0b5 built
rocm-10.1-ga_rccl-develop-perf gcc-13.2 13.2.0 13.2.0 cached
rocm-10.1-ga_rccl-develop-perf rocm-10.1-ga 10.1.0 10.1.0 built 63s
rocm-10.1-ga_rccl-develop-perf openmpi-5.0.8 5.0.8 5.0.8 cached
rocm-10.1-ga_rccl-develop-perf rccl-develop develop ea604d4 built 87s
rocm-10.1-ga_rccl-develop-perf rccl-tests-develop-perf develop ea604d4 built 12s

Failures

No failing tests in this run.

183 tests skipped.

@github-actions

Copy link
Copy Markdown
Contributor

pr-rocm-systems-10666-ruby64-rccl-pr-build

Builds

Stack Component Version Commit Status Build time
pr-10666_rccl-backtrace_rocm-10.1-ga gcc-11.5 11.5.0 11.5.0 cached
pr-10666_rccl-backtrace_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-backtrace_rocm-10.1-ga openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-10666_rccl-backtrace_rocm-10.1-ga rccl-pr-10666-backtrace 2dac0b5 2dac0b5 built 474s
pr-10666_rccl-backtrace_rocm-10.1-ga rccl_gtest-pr-10666 2dac0b5 2dac0b5 built
pr-10666_rccl-debug_rocm-10.1-ga gcc-11.5 11.5.0 11.5.0 cached
pr-10666_rccl-debug_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-debug_rocm-10.1-ga openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-10666_rccl-debug_rocm-10.1-ga rccl-pr-10666 2dac0b5 2dac0b5 cached
pr-10666_rccl-debug_rocm-10.1-ga rccl_gtest-pr-10666-debug 2dac0b5 2dac0b5 built 371s
pr-10666_rccl-perf_rocm-10.1-ga gcc-11.5 11.5.0 11.5.0 cached
pr-10666_rccl-perf_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-perf_rocm-10.1-ga openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-10666_rccl-perf_rocm-10.1-ga rccl-pr-10666 2dac0b5 2dac0b5 built 350s
pr-10666_rccl-perf_rocm-10.1-ga rcclt-develop-perf develop ea604d4 built 65s
pr-10666_rccl-perf_rocm-10.2-latest gcc-11.5 11.5.0 11.5.0 cached
pr-10666_rccl-perf_rocm-10.2-latest rocm-10.2-latest 10.2.0rc0 10.2.0rc0 built 26s
pr-10666_rccl-perf_rocm-10.2-latest openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-10666_rccl-perf_rocm-10.2-latest rccl-pr-10666 2dac0b5 2dac0b5 built 301s
pr-10666_rccl-perf_rocm-10.2-latest rcclt-develop-perf develop ea604d4 built 66s
pr-10666_rccl_rocm-7.0.2.2 gcc-11.5 11.5.0 11.5.0 cached
pr-10666_rccl_rocm-7.0.2.2 rocm-7.0.2.2 7.0.2.2 7.0.2.2 cached
pr-10666_rccl_rocm-7.0.2.2 openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-10666_rccl_rocm-7.0.2.2 rccl-pr-10666 2dac0b5 2dac0b5 built 361s
pr-10666_rccl_rocm-7.0.2.2 rccl_gtest-pr-10666 2dac0b5 2dac0b5 built
rocm-10.1-ga_rccl-develop-perf gcc-11.5 11.5.0 11.5.0 cached
rocm-10.1-ga_rccl-develop-perf rocm-10.1-ga 10.1.0 10.1.0 built 24s
rocm-10.1-ga_rccl-develop-perf openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
rocm-10.1-ga_rccl-develop-perf rccl-develop develop ea604d4 built 576s
rocm-10.1-ga_rccl-develop-perf rcclt-develop-perf develop ea604d4 built 67s

Failures

No failing tests in this run.

183 tests skipped.

@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: prims_ll128.h:46. Worth clearing before approval.

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

@github-actions github-actions Bot removed the Stale PR has no activity for 25+ days label Oct 28, 2026
…d gate it per arch

Follow-up to #14128 (commit 1, c34bb45, "perf(rccl): keep LL128
lane state in registers"). #14128 fixes a real LL128 bottleneck: the
Primitives object lives in scratch, so the slice loop reloaded the lane
id and peer 0's FIFO pointer and flag after the remote FIFO stores, and
on gfx9 the vmcnt(0) guarding that reload also waits for those stores.
This change keeps the fix and changes how it is expressed:

- Keep NCCL's names. wid and flagThread stay at all 22 use sites in
  prims_ll128.h instead of being renamed to laneId()/isFlagLane(). When the feature
  is enabled they are [[no_unique_address]] empty members whose
  conversion operators read __lane_id(), so they take no storage and
  the generated code is the same as #14128's.
- Gate it per arch at compile time. RCCL_LL128_HW_LANE_ENABLE is
  defined for __gfx1250__/__gfx950__. Every other arch keeps
  the original stored members and the per-slice reads of
  peer 0's FIFO pointer and flag. Enabling another arch is a one-line change.
- Revert the rename in tdm/ll128Tdm.h.

Why keep the names: RCCL syncs prims_ll128.h with NCCL. NCCL's
prims_ll128.h (2.30 and 2.32) uses the same wid and flagThread members
on 28 lines, and with this change 18 of RCCL's lines that use them are
identical to NCCL's. With the rename, every NCCL sync conflicts on
those lines, and any new NCCL code that uses wid or flagThread stops
compiling (the members no longer exist) and has to be rewritten on each
sync. Keeping the names leaves those lines identical to NCCL, and new
NCCL code compiles unchanged and picks up the hardware lane.

Why opt in per arch: the change is device code in the LL128 slice loop
of every collective (and send/recv where it uses LL128) on every arch.
A compile-time gate lets each arch adopt it after validation, with no
runtime check in the hot loop and no duplicate kernels. Disabled, the
code is the code from before #14128.

Correctness:
- The hardware lane equals tid % WARP_SIZE only if every LL128
  Primitives group starts on a warp boundary. Every construction site
  meets this: the LL128 tree split rounds to whole warps, the batch
  dispatcher uses nWarps * WARP_SIZE threads, the warp-speed path
  passes tid % WARP_SIZE, other offset-tid constructions are
  Simple-only, and WARP_SIZE matches the hardware wave (64 on GFX9,
  32 otherwise). The requirement is documented next to the members.
- Peer 0's step only advances after the slice loop, and waitSend runs
  before the hoisted values are read, so computing them once per op
  gives the same values.
- wid converts implicitly to int and flagThread to bool, which covers
  every current use (subscripts, arithmetic, comparisons,
  ll128SlotIx<...>(g, wid), !, &&, the ternary). Code that needs a real
  int (auto, varargs, template deduction) should write int(wid).

Validation (on a tree carrying #14128 commit 1 backported to an older
drop; per-function machine-code comparison of the device code objects):
- gfx950 (enabled): 9146/9146 functions byte-identical to #14128.
- gfx942 (disabled): 9279/9279 functions byte-identical to before
  #14128. gfx950 with its guard removed: 9150/9150 byte-identical to
  before #14128, so the disabled path is the pre-#14128 code.
- Hardware, gfx950 enabled, same rccl-tests sweeps
  as #14128 (bf16; AllReduce, ReduceScatter, AllGather, AllToAll; 3 jobs
  per scale; same flags and placement): MI355X (Pollara) 1/2/4/8 nodes
  and MI350X (Thor2) 1/2/4/8/16 nodes, median bus bandwidth within
  +/-0.5% of #14128 for every collective and scale; 0 wrong values.
- gfx1250: the technique (empty members, implicit conversions in every
  usage pattern above, and a static_assert that the members take no
  storage) compiles for gfx1250 with TheRock clang. Not run on gfx1250
  hardware.

For reference, #14128 itself on gfx950 (MI350X and MI355X, 1-16 nodes,
bf16 rccl-tests, compared with the same build without it): scratch
loads inside loops -16%, vmcnt(0) waits inside loops -6%, instructions
-4%; bus bandwidth at LL128 sizes on 2-16 nodes AllReduce +25% to +29%,
ReduceScatter +17% to +21%, AllGather +5% to +10%; other sizes within
noise; 0 wrong values in 23,280 result rows.
Comment thread projects/rccl/src/CMakeLists.txt Outdated
Comment on lines 1453 to 1497

# Print whether gfx1250 cooperative 128-bit atomics are actually selected, per
# GPU target, on every build. A #pragma message in rccl_ptr.h would not show up:
# the device linker compiles with -w, which drops it. This syntax-only compile
# does not.
if(REPORT_COOPERATIVE_ATOMICS)
set(_rccl_coop_log_src "${CMAKE_CURRENT_BINARY_DIR}/rccl_coop_atomic_log.hip")
file(WRITE "${_rccl_coop_log_src}" [=[
#ifdef __HIP_DEVICE_COMPILE__
#include "rccl_ptr.h"
#if RCCL_HAVE_COOPERATIVE_ATOMIC_BUILTINS
#pragma message("RCCL cooperative atomic builtins: on (" __amdgcn_processor__ ")")
#else
#pragma message("RCCL cooperative atomic builtins: off (" __amdgcn_processor__ ")")
#endif
#endif
__global__ void rcclCoopAtomicLog() {}
]=])
set(_rccl_coop_log_flags
-x hip -std=c++17 -fsyntax-only -Wno-unused-command-line-argument
-I${RCCL_SOURCE_DIR}/src/include/nccl_device
)
if(NOT DWORDX4_INTRINSICS)
list(APPEND _rccl_coop_log_flags -DDWORDX4_INTRINSICS_FORCE_OFF)
endif()
# Target features (e.g. :xnack+) do not change the result.
set(_rccl_coop_archs "")
foreach(_rccl_coop_arch_raw ${GPU_TARGETS})
string(REGEX REPLACE ":.*" "" _rccl_coop_arch "${_rccl_coop_arch_raw}")
list(APPEND _rccl_coop_archs "${_rccl_coop_arch}")
endforeach()
list(REMOVE_DUPLICATES _rccl_coop_archs)
set(_rccl_coop_log_cmds "")
foreach(_rccl_coop_arch ${_rccl_coop_archs})
list(APPEND _rccl_coop_log_cmds
COMMAND ${CMAKE_CXX_COMPILER} --offload-arch=${_rccl_coop_arch} ${_rccl_coop_log_flags} ${_rccl_coop_log_src})
endforeach()
add_custom_target(rccl_log_cooperative_atomics ALL
${_rccl_coop_log_cmds}
COMMENT "RCCL cooperative atomic builtins"
VERBATIM
)
endif()
## Set RCCL linked library directories
target_link_directories(rccl PRIVATE ${SMI_LIB_DIR})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we can remove this check.

alex-breslow-amd and others added 7 commits November 3, 2026 00:45
Co-authored-by: Cursor <cursoragent@cursor.com>
ROCm 10.1's compiler lowers __builtin_amdgcn_cooperative_atomic_load_8x16B
to an i128 ATOMIC_LOAD whose computed known bits have the wrong width. Masks
on the result crash instruction selection (APInt::andAssignSlowCase) or
silently miscompile.

Pass the cooperative load result through rcclIdentity, which on ROCm < 10.2
wraps llvm.amdgcn.softwqm: it lowers to a copy outside WQM, but the
SelectionDAG cannot see through it. On ROCm >= 10.2 it is a plain identity.
The store side never needed the workaround, so store128Fifo fills the union
directly.

Co-authored-by: Cursor <cursoragent@cursor.com>
- store128Fifo: delegate the system-scope non-cooperative path to store128.
- Update the skip_fence comment to cover the gfx1250 cooperative store.
- Make the cooperative-atomic configure report opt-in
  (-DREPORT_COOPERATIVE_ATOMICS=ON), strip target features and dedupe
  GPU_TARGETS, honor DWORDX4_INTRINSICS=OFF, and rerun on every build.

Co-authored-by: Cursor <cursoragent@cursor.com>
… path

- ddaLL128LoadAtomic16B passes the cooperative 8x16B load result through
  rcclIdentity, like load128Fifo.
- LlFifoSysScopeDeviceTest.Gfx1250SelectsCooperative checks that gfx1250
  selects the cooperative builtins unless they are forced off.
- LlFifoSysScopeDeviceTest.CooperativeLineRoundtrip runs a single-GPU
  cooperative store/load round trip over whole waves and masks a reloaded
  line; without rcclIdentity that mask crashes ROCm 10.1 instruction
  selection.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ction

rccl-UnitTestsFixtures defines DWORDX4_INTRINSICS_FORCE_OFF, which also
forces the cooperative builtins off, so the cooperative tests compiled only
their fallback branch and the guard checks compared 0 with 0. Undefine it in
this file; its kernels use b128 and cooperative atomics only on gfx1250, so
the gfx942 fault behind the define does not apply.

Co-authored-by: Cursor <cursoragent@cursor.com>
ROCm 10.2 pre-release compilers (TheRock 10.2.0a20261013) still crash in
instruction selection (APInt::andAssignSlowCase) on the raw
cooperative_atomic_load_8x16B result, in the fp8 prod Tree LL128 AllReduce
kernels. Drop the ROCM_VERSION < 100200 gate so the softwqm identity is
always applied on gfx1250.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alex-breslow-amd
alex-breslow-amd force-pushed the users/abreslow/ll128_cleanup branch from b1808a4 to 539fa50 Compare November 3, 2026 03:31
Drop the REPORT_COOPERATIVE_ATOMICS option and the syntax-only compile that
printed, per GPU target, whether the gfx1250 cooperative 128-bit atomics are
selected. LlFifoSysScopeDeviceTest.Gfx1250SelectsCooperative already checks
the selection on the device.

Co-authored-by: Cursor <cursoragent@cursor.com>

@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: LGTM.

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

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

pr-rocm-systems-10666-oci-rccl-pr-build

View this job on CoCo

Builds

Stack Component Version Commit Status Build time
pr-10666_rccl-backtrace_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-backtrace_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-backtrace_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-backtrace_rocm-10.1-ga rccl-pr-10666-backtrace bcce684 bcce684 built 137s
pr-10666_rccl-backtrace_rocm-10.1-ga rccl_gtest-pr-10666 bcce684 bcce684 built
pr-10666_rccl-debug_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-debug_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 built 65s
pr-10666_rccl-debug_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-debug_rocm-10.1-ga rccl-pr-10666-debug bcce684 bcce684 built 119s
pr-10666_rccl-debug_rocm-10.1-ga rccl-tests-develop-perf develop f8f2808 built 11s
pr-10666_rccl-perf_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-perf_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-perf_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-perf_rocm-10.1-ga rccl-pr-10666 bcce684 bcce684 built 90s
pr-10666_rccl-perf_rocm-10.1-ga rccl-tests-develop-perf develop f8f2808 built 11s
pr-10666_rccl-perf_rocm-10.2-latest gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-perf_rocm-10.2-latest rocm-10.2-latest 10.2.0rc1 10.2.0rc1 built 70s
pr-10666_rccl-perf_rocm-10.2-latest openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-perf_rocm-10.2-latest rccl-pr-10666 bcce684 bcce684 built 87s
pr-10666_rccl-perf_rocm-10.2-latest rccl-tests-develop-perf develop f8f2808 built 13s
pr-10666_rccl-smoke_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-smoke_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-smoke_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-smoke_rocm-10.1-ga rccl-pr-10666-smoke bcce684 bcce684 built 135s
pr-10666_rccl-smoke_rocm-10.1-ga rccl_gtest-pr-10666 bcce684 bcce684 built
pr-10666_rccl_rocm-7.0.2 gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl_rocm-7.0.2 rocm-7.0.2 7.0.2 7.0.2 cached
pr-10666_rccl_rocm-7.0.2 openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl_rocm-7.0.2 rccl-pr-10666 bcce684 bcce684 built 141s
pr-10666_rccl_rocm-7.0.2 rccl_gtest-pr-10666 bcce684 bcce684 built
rocm-10.1-ga_rccl-develop-perf gcc-13.2 13.2.0 13.2.0 cached
rocm-10.1-ga_rccl-develop-perf rocm-10.1-ga 10.1.0 10.1.0 cached
rocm-10.1-ga_rccl-develop-perf openmpi-5.0.8 5.0.8 5.0.8 cached
rocm-10.1-ga_rccl-develop-perf rccl-develop-f5cc5b40a2d7 f5cc5b4 f5cc5b4 built 90s
rocm-10.1-ga_rccl-develop-perf rccl-tests-develop-perf develop f8f2808 built 11s

Failures

No failing tests in this run.

189 tests skipped.

pr-rocm-systems-10666-oci-rccl-pr-smoke

View this job on CoCo

Builds

Stack Component Version Commit Status Build time
pr-10666_rccl-perf_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-perf_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-perf_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-perf_rocm-10.1-ga rccl-pr-10666 bcce684 bcce684 cached
pr-10666_rccl-perf_rocm-10.1-ga rccl-tests-develop-perf develop f8f2808 cached
pr-10666_rccl-perf_rocm-10.2-latest gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-perf_rocm-10.2-latest rocm-10.2-latest 10.2.0rc1 10.2.0rc1 cached
pr-10666_rccl-perf_rocm-10.2-latest openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-perf_rocm-10.2-latest rccl-pr-10666 bcce684 bcce684 cached
pr-10666_rccl-perf_rocm-10.2-latest rccl-tests-develop-perf develop f8f2808 cached
pr-10666_rccl-smoke_rocm-10.1-ga gcc-13.2 13.2.0 13.2.0 cached
pr-10666_rccl-smoke_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-smoke_rocm-10.1-ga openmpi-5.0.8 5.0.8 5.0.8 cached
pr-10666_rccl-smoke_rocm-10.1-ga rccl-pr-10666-smoke bcce684 bcce684 cached
pr-10666_rccl-smoke_rocm-10.1-ga rccl_gtest-pr-10666 bcce684 bcce684 cached
rocm-10.1-ga_rccl-develop-perf gcc-13.2 13.2.0 13.2.0 cached
rocm-10.1-ga_rccl-develop-perf rocm-10.1-ga 10.1.0 10.1.0 cached
rocm-10.1-ga_rccl-develop-perf openmpi-5.0.8 5.0.8 5.0.8 cached
rocm-10.1-ga_rccl-develop-perf rccl-develop-f5cc5b40a2d7 f5cc5b4 f5cc5b4 cached
rocm-10.1-ga_rccl-develop-perf rccl-tests-develop-perf develop f8f2808 cached

Failures

Stack Type Subtype Tag Test Topology Case Status Message
pr-10666_rccl-perf_rocm-10.2-latest rccl_test regression-reduce-scatter-fp32-sum reduce_scatter_perf 4n_8ppn_amd-rccl Timeout Timed out (exit code 124)

15 tests skipped.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

pr-rocm-systems-10666-ruby64-rccl-pr-smoke

View this job on CoCo

Builds

Stack Component Version Commit Status Build time
pr-10666_rccl-perf_rocm-10.1-ga gcc-11.5 11.5.0 11.5.0 cached
pr-10666_rccl-perf_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-perf_rocm-10.1-ga openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-10666_rccl-perf_rocm-10.1-ga rccl-pr-10666 bcce684 bcce684 cached
pr-10666_rccl-perf_rocm-10.1-ga rcclt-develop-perf develop f8f2808 cached
pr-10666_rccl-perf_rocm-10.2-latest gcc-11.5 11.5.0 11.5.0 cached
pr-10666_rccl-perf_rocm-10.2-latest rocm-10.2-latest 10.2.0rc1 10.2.0rc1 cached
pr-10666_rccl-perf_rocm-10.2-latest openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-10666_rccl-perf_rocm-10.2-latest rccl-pr-10666 bcce684 bcce684 cached
pr-10666_rccl-perf_rocm-10.2-latest rcclt-develop-perf develop f8f2808 cached
pr-10666_rccl-smoke_rocm-10.1-ga gcc-11.5 11.5.0 11.5.0 cached
pr-10666_rccl-smoke_rocm-10.1-ga rocm-10.1-ga 10.1.0 10.1.0 cached
pr-10666_rccl-smoke_rocm-10.1-ga openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
pr-10666_rccl-smoke_rocm-10.1-ga rccl-pr-10666-smoke bcce684 bcce684 cached
pr-10666_rccl-smoke_rocm-10.1-ga rccl_gtest-pr-10666 bcce684 bcce684 cached
rocm-10.1-ga_rccl-develop-perf gcc-11.5 11.5.0 11.5.0 cached
rocm-10.1-ga_rccl-develop-perf rocm-10.1-ga 10.1.0 10.1.0 cached
rocm-10.1-ga_rccl-develop-perf openmpi-4.0.2 4.0.2rc3 4.0.2rc3 cached
rocm-10.1-ga_rccl-develop-perf rccl-develop-f5cc5b40a2d7 f5cc5b4 f5cc5b4 cached
rocm-10.1-ga_rccl-develop-perf rcclt-develop-perf develop f8f2808 cached

Failures

No failing tests in this run.

15 tests skipped.

This branch has not been deployed

No deployments
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.

5 participants