Skip to content

fix(ep): fail fast for cross-node kernels on the CCO backend - #894

Merged
kawhil-amd merged 2 commits into
ROCm:mainfrom
paklui:fix/ep-internode-cco-guard
Nov 5, 2026
Merged

kawhil-amd merged 2 commits into
ROCm:mainfrom
paklui:fix/ep-internode-cco-guard

Conversation

@paklui

@paklui paklui commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Summary

On gfx125x, MORI_EP_COMM defaults to cco. In that mode MallocSymm fills only localPtr and the LSA peer pointers of each symmetric buffer; peerPtrs, peerRkeys and lkey stay null. The cross-node kernels (InterNode, InterNodeV1/V1LL, AsyncLL) send with the shmem RDMA put, which reads dest->peerPtrs[pe] and dest->peerRkeys[pe]. So the first cross-node put dereferences a null pointer, and the GPU faults at address 0.

This PR fails at EpDispatchCombineHandle construction instead, with a message that names the cause and the alternatives. It is the same pattern as the existing rail-only check, +17 lines in dispatch_combine.cpp. Supporting the CCO backend across nodes (registering the CCO arena for RDMA) is a separate change.

Testing

On gfx1250: 2 x 4 GPUs (GPU_PER_NODE=4), default backend, --kernel-type v1_ll. Every rank now raises the new RuntimeError in the constructor; no kernel is launched and no GPU fault occurs. Previously this configuration hit the null-address fault.

Internal tracking: AIMORI-20.

@paklui
paklui force-pushed the fix/ep-internode-cco-guard branch from 304aff4 to 60aa380 Compare November 2, 2026 15:53
@kawhil-amd

Copy link
Copy Markdown
Contributor

Thank you for the contribution ! A clear error at construction is much better than a GPU fault at address 0. @paklui

Note for gfx1250

  • Please use EPv2 (mori.ops.dispatch_combine_v2) on gfx1250. EPv1 on gfx1250 is not verified.
  • EP scale-out (by RDMA) on gfx1250 is not verified yet. We have not had time and resources to test it yet. Do not treat the scale-out case on gfx1250 as supported for now.

Review points

  1. Use an allow-list. The guard checks four kernel types. Use useCcoComm && worldSize > gpuPerNode and reject all kernel types. A new kernel type is then blocked by default.
  2. Update the old comment. The comment at dispatch_combine.cpp:159 says CCO has its own CCO_GDA_CONNECTION_RAIL. This now conflicts with the new guard.
  3. Add a test. Build a handle with a CCO comm and worldSize > gpuPerNode. Expect std::runtime_error.

paklui and others added 2 commits November 3, 2026 14:15
On gfx125x the EP communication backend defaults to CCO (MORI_EP_COMM=cco).
The cross-node kernels (InterNode v0, InterNodeV1/V1LL, AsyncLL) move data
with the shmem RDMA API, which reads the remote address and rkey from
SymmMemObj::peerPtrs / peerRkeys. The CCO MallocSymm only fills
p2pPeerPtrs for LSA peers and leaves the RDMA fields null, so with
worldSize > gpuPerNode the first cross-node put dereferences a null
pointer on the GPU:

  Memory access fault by GPU node-N ... on address (nil)
  amdgpu: GCVM_L2_PROTECTION_FAULT ... page starting at address 0x0
          from IH client 27 (GC_UTCL2), client TCP

Seen on 2 nodes x 8 gfx1250 GPUs with InterNodeV1LL
(MORI_EP_DISABLE_RDMA_ATOMICS=1), with and without
MORI_CCO_FABRIC_DISABLE=1.

Throw at handle construction with a message that names the cause and the
alternatives, the same way the rail-only and atomic-free checks do. A
functional fix needs the CCO arena registered for RDMA (MR plus rkey and
remote VA exchange) and those fields copied into each sub-region object.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-up:
- The check now runs first in the EpDispatchCombineHandle constructor and rejects any kernel type
  when the CCO backend is used with worldSize > gpuPerNode, so kernel types added later are
  rejected by default. The message points to EPv2 (mori.ops.dispatch_combine_v2).
- The rail-only comment no longer claims that CCO has its own connection rail for this path.
- tests/python/ops/test_dispatch_combine_cco_guard.py builds a handle with a placeholder CCO
  communicator pointer (never dereferenced) and a cross-node config, for every kernel type, and
  expects RuntimeError. It needs no GPU, shmem or CCO setup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@paklui
paklui force-pushed the fix/ep-internode-cco-guard branch from 60aa380 to ac15d09 Compare November 3, 2026 22:24
@paklui

paklui commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Updated (rebased on main, new commit ac15d09):

  1. Allow-list: the check is now the first thing in the EpDispatchCombineHandle constructor and rejects every kernel type when the CCO backend is used with worldSize > gpuPerNode, so new kernel types are rejected by default. The message points to EPv2 (mori.ops.dispatch_combine_v2).
  2. Old comment: the rail-only comment no longer says CCO has its own connection rail for this path; it now notes that cross-node CCO handles are rejected at the top of the constructor.
  3. Test: tests/python/ops/test_dispatch_combine_cco_guard.py builds a handle with a placeholder CCO communicator pointer (never dereferenced, since the check runs first) and a cross-node config, for every kernel type, and expects RuntimeError. It needs no GPU, shmem or CCO setup (6 passed locally).

Noted on gfx1250: EPv1 and RDMA scale-out are not verified there; we will move our gfx1250 testing to EPv2.

@kawhil-amd kawhil-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.

LGTM @jhchouuu maybe you could help to check it again

@jhchouuu jhchouuu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@kawhil-amd
kawhil-amd merged commit 6ff58c3 into ROCm:main Nov 5, 2026
16 of 17 checks passed
zhangfei829 added a commit that referenced this pull request Nov 9, 2026
EP v1 got a cco backend in #532 so that it could run on gfx1250, where shmem init can hang. The previous commit took gfx125x away from EP v1, and nothing else selects the backend: on wave64 it was opt-in with MORI_EP_COMM=cco, and no CI job, test or caller sets that except the backend's own guard test.

Removed: the MORI_EP_COMM switch and the process-wide cco communicator on the Python side; EpDispatchCombineHandle's cco_comm_ptr argument and its cco arena (the window, the sub-region bookkeeping, FinalizeCcoAllocs); the cross-node guard that #894 added for this backend, with its test; the shmem-init skip in bench_dispatch_combine.py; and mori_ops' link against mori_cco, which only this code used. MallocSymm and FreeSymmByLocalPtr stay as the handle's shmem allocation helpers, so their callers are unchanged.

Kept: ccoGetPeerPtr and CCO_GDR_CAPABLE in the cco library, which the torch SymmetricMemory backend and the known-issues workaround use; and the s_sleep in the intranode cross-device barrier, which runs on every wave64 GPU. Only its comment is gone: it described a hang on the removed backend under a dispatch kernel that no longer exists. An EP v2 comment that named EpDispatchCombineHandle::MallocSymm as the arena now names SymmArena, which is what EP v2 allocates from.
zhangfei829 added a commit that referenced this pull request Nov 10, 2026
EP v1 got a cco backend in #532 so that it could run on gfx1250, where shmem init can hang. The previous commit took gfx125x away from EP v1, and nothing else selects the backend: on wave64 it was opt-in with MORI_EP_COMM=cco, and no CI job, test or caller sets that except the backend's own guard test.

Removed: the MORI_EP_COMM switch and the process-wide cco communicator on the Python side; EpDispatchCombineHandle's cco_comm_ptr argument and its cco arena (the window, the sub-region bookkeeping, FinalizeCcoAllocs); the cross-node guard that #894 added for this backend, with its test; the shmem-init skip in bench_dispatch_combine.py; and mori_ops' link against mori_cco, which only this code used. MallocSymm and FreeSymmByLocalPtr stay as the handle's shmem allocation helpers, so their callers are unchanged.

Kept: ccoGetPeerPtr and CCO_GDR_CAPABLE in the cco library, which the torch SymmetricMemory backend and the known-issues workaround use; and the s_sleep in the intranode cross-device barrier, which runs on every wave64 GPU. Only its comment is gone: it described a hang on the removed backend under a dispatch kernel that no longer exists.
zhangfei829 added a commit that referenced this pull request Nov 12, 2026
* refactor(ep): remove the EP v1 gfx125x code

EP v2 is the dispatch/combine path on gfx125x. EP v1 keeps only its portable body and now refuses to start on a wave32 GPU instead of launching kernels sized for wave64.

Removed: the gfx125x TDM bodies (src/ops/dispatch_combine/intranode_1250x.hpp), the per-arch body selector (intranode_entry.hpp) with its _ENTRY wrapper macros, tools/ep_test.sh, and on the Python side the gfx125x launch geometry, LDS reservations, staging-capacity check, cco default and wave32 detection. The JIT no longer passes -DMORI_HOST_GFX125X, which nothing reads any more, and EP v2 picks its default backend without importing EP v1.

The cco backend stays, selected with MORI_EP_COMM=cco.

* refactor(ep): remove EP v1's cco backend

EP v1 got a cco backend in #532 so that it could run on gfx1250, where shmem init can hang. The previous commit took gfx125x away from EP v1, and nothing else selects the backend: on wave64 it was opt-in with MORI_EP_COMM=cco, and no CI job, test or caller sets that except the backend's own guard test.

Removed: the MORI_EP_COMM switch and the process-wide cco communicator on the Python side; EpDispatchCombineHandle's cco_comm_ptr argument and its cco arena (the window, the sub-region bookkeeping, FinalizeCcoAllocs); the cross-node guard that #894 added for this backend, with its test; the shmem-init skip in bench_dispatch_combine.py; and mori_ops' link against mori_cco, which only this code used. MallocSymm and FreeSymmByLocalPtr stay as the handle's shmem allocation helpers, so their callers are unchanged.

Kept: ccoGetPeerPtr and CCO_GDR_CAPABLE in the cco library, which the torch SymmetricMemory backend and the known-issues workaround use; and the s_sleep in the intranode cross-device barrier, which runs on every wave64 GPU. Only its comment is gone: it described a hang on the removed backend under a dispatch kernel that no longer exists.

* refactor(ep): drop the wave32 branch EP v1 left in WarpQuantizeToFp8Blockwise

#532 gave WarpQuantizeToFp8Blockwise a warpSize == 32 branch for EP v1's gfx125x combine. Only EP v1 calls the function (intranode.hpp, low_latency_async.cpp; EP v2 does not), and EP v1 now refuses wave32 GPUs, so nothing can reach the branch. On wave64 it was already compiled out.

* refactor(ep): warn that EP v1 ignores MORI_EP_COMM

MORI_EP_COMM=cco selected EP v1's cco backend on wave64. With that backend removed the variable did nothing, so a caller who still set it got shmem without a word. EP v1 now logs a warning when the variable is set.

* docs(ep): stop naming the files the EP v1 gfx125x removal deleted

MORI_JIT_V2_DESIGN.md named tools/ep_test.sh and src/ops/dispatch_combine/intranode_1250x.hpp, and the EP v2 README named the latter. The sentences now say what those files were: v1's shipping defaults, and v1's gfx1250 kernels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants