Repository navigation
feat(cco): expose ccoSdma's full put/get API to FlyDSL and Triton - #792
Merged
Merged
Conversation
Follow-up to #786, which added cco_sdma_put_ptr_rsig__thread and cco_sdma_signal_slot to the device bitcode only. - cco.hpp: add ccoSdma::putPtr (put() on resolved addresses; put() now calls it) and ccoSdma::signalSlot (nullptr when out of range). - Wrapper: call those instead of the internal ccoSdmaDispatchChunked; cco_sdma_signal_slot returns 0 for an out-of-range rank or queue. - Register both in ops.py and flydsl/_bindings.py; expose them as Sdma.put_ptr / Sdma.signal_slot in the FlyDSL and Triton handles. - test_triton_cco.py (sdma): put_ptr to the next rank, poll signal_slot, check the payload, exactly one signal, and the out-of-range cases. - test_triton_bindings.py: the cov5 bitcode may not define a cco_ symbol that is not registered. - README: correct the "Adding a new device op" steps. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The window put/get wrappers baked one template combination into each symbol
(local signal or none, Aggregate only), so remote signals, both signals at
once, SignalPerCopy, SameQueue and waitSignal were unreachable from the DSLs.
- cco.hpp: add ccoSdma::getPtr (get() now calls it, no behaviour change).
- Wrapper: cco_sdma_{put,get}_ptr__<coop>(..., flags) carry every other
template axis in `flags` (SdmaFlags: Aggregate, SignalPerCopy, local and
remote signal, SameQueue). The wrapper is inlined, so a constant `flags`
folds to one instantiation (Triton put_ptr: 355 instructions vs 7968 with
a runtime `flags`). Also cco_sdma_wait_signal and cco_local_ptr. Existing
symbols are unchanged.
- Python: Sdma.put / get / put_ptr / get_ptr / wait_signal / signal_slot in
FlyDSL and Triton, with C++'s template arguments as keywords (coop,
local_signal, remote_signal, aggregate, signal_per_copy, same_queue).
put / get route through put_ptr / get_ptr; their `signal=` keeps working
and a call naming no signal keeps the old local-signal default.
- FlyDSL binds every registered function (_bindings.ALL).
- Tests: Triton compile check of the SameQueue/warp rejection, argument types
checked against the bitcode, reverse check against all registered symbols,
a constant-folding check, a GPU signal matrix (put_ptr / get_ptr / put x
local x remote x per-copy: counts and payloads), a FlyDSL signals test.
- Review fixes: putPtr/getPtr static_assert messages and comments,
signalSlot acquire note, the put_ptr test's one-signal-per-wave comment,
README "Adding a new device op".
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
kawhil-amd
reviewed
Oct 20, 2026
| """Wait on a single (peer, queueId) queue only.""" | ||
| raw.cco_sdma_quiet_queue(self.dev_comm, peer, qid) | ||
|
|
||
| def wait_signal(self, src_lsa_rank, qid, expected): |
Contributor
There was a problem hiding this comment.
seems lack the put_remote_signal impl?
yangyuhuiling
pushed a commit
that referenced
this pull request
Oct 28, 2026
Conflict in tests/python/cco/test_triton_bindings.py: main (#792) now checks the FlyDSL ABI over _bindings.ALL and counts 80 functions; the 12 put2d/get2d entries from this branch make it 92. Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #786, and the rest of the SDMA device API with it.
#786 added
cco_sdma_put_ptr_rsig__thread/cco_sdma_signal_slotto the device bitcode only. More broadly, the window put/get wrappers bake one template combination into each symbol (local signal or none, Aggregate only), so from FlyDSL and Triton a put could not signal the peer, could not signal both sides, and there was nowaitSignalto consume a signal at all (gemm_ar'skernels_sdma.pyworks around exactly this with an LSA atomic).Approach
Mirror
ccoSdmaone-to-one instead of adding one symbol per combination.cco_sdma_{put,get}_ptr__<coop>(dc, peer, dst, src, n, qid, flags)callccoSdma::putPtr/getPtr; every template axis besides Coop rides inflags(SdmaFlags: AGGREGATE, SIGNAL_PER_COPY, LOCAL_SIGNAL, REMOTE_SIGNAL, SAME_QUEUE). The wrapper is inlined into the caller, so a constantflagsfolds to the one instantiation: Tritonput_ptrcompiles to 355 instructions with a constantflagsvs 7968 with a runtime one; FlyDSL's newputISA matches the old window wrapper's (528 vs 527 lines). Unknown bits and SAME_QUEUE off thread scope trap. Pluscco_sdma_wait_signalandcco_local_ptr(ccoGetLocalPtr).ccoSdma::putPtr/getPtr(put/get delegate, no behaviour change) andsignalSlot(bounds-checked).Sdma.put / get / put_ptr / get_ptr / wait_signal / signal_slot, with C++'s template arguments as compile-time keywords:coop,local_signal,remote_signal,aggregate,signal_per_copy,same_queue.put/getresolve the addresses and callput_ptr/get_ptr, exactly as C++put()callsputPtr().CCO_DEVICE_FUNCTIONS; FlyDSL now binds every entry (_bindings.ALL), so a registered function can no longer lack a binding.Compatibility
cco_sdma_put_ptr_rsig__thread, which aiter links by name).signal=still works onput/get, and a call naming no signal keeps the old default (a local signal). gemm_ar, benchmark and examples need no change.Tests
test_triton_bindings.py: argument and return types of every symbol checked against the bitcode (was return types only); the reverse check (no unregisteredcco_symbol) compares against all registered symbols; FlyDSL's binding set equals the registry; SAME_QUEUE with warp scope is rejected; constantflagsmust fold.examples/cco/ir/test_triton_cco.py --transport sdma(run bytest_triton_sdma.py): a signal matrix over put_ptr / get_ptr / window put × local × remote × per-copy, checking each counter's delta and the payload, andwait_signalon the remote one. Swapping the local and remote bits makes it fail.test_sdma_api.py::test_sdma_signals: FlyDSL put (both signals), put_ptr (remote), get_ptr (local) consumed bywait_signal.On MI308X (ROCm 7.14,
BUILD_CCO_SDMA=ON): bindings + Triton SDMA 12/12; all 133 Triton axis combinations compile;test_sdma_api.py13/13 withsdma_queue_countlowered to 3 (as committed it asks for 8 queues per pair, which MI308X cannot create:NO_MEMORYatanvil.cpp:210, pre-existing); example 07 passes.test_flydsl_ar.py: 23 pass, the same 3 fail before and after this change (4/8-rank SDMA queues on MI308X, aiter comparison). gemm_ar's end-to-end tests cannot run here (the GEMM kernel hits an LLVM error with this FlyDSL), unrelated.🤖 Generated with Claude Code