feat: Add Ascend RDMA support#179
Conversation
bb0bc75 to
0eef4e9
Compare
6c85c69 to
c097910
Compare
Restore the libshmem_device proxy API surface by removing explicit _semantic parameters from the dispatch stubs, and teach ModuleProxy.dispatch to advertise _semantic in its generated builtin wrapper signature. This is needed because the Ascend backend uses triton-ascend, whose Triton 3.5-style code generator only injects _semantic when it appears in the callable signature. The previous proxy wrapper accepted **kwargs, which was enough for Triton 3.4 backends where _semantic was always injected, but its wrapped stub signature did not expose _semantic to signature introspection. Adding _semantic at the ModuleProxy layer keeps the shared proxy API clean while allowing Triton 3.5 to pass the compiler semantic context through to Ascend extern implementations. Forward _semantic only when the selected backend method accepts it, preserving compatibility with CUDA, HIP, and MACA implementations that may use different internal conventions.
Pick up the aclshmem_finalize spelling fix and update Ascend tests/tutorials to use the corrected APIs.
Add Ascend ACLSHMEM wrappers for RMA, put-signal, wait, quiet, and fence operations with dtype suffix mapping. Expose ACL SHMEM signal/compare constants and wire Ascend SHMEM extern handling.
c097910 to
e0fc6a1
Compare
|
Built this on a single-node Ascend 910 (16 chips, no RDMA NIC) and ran the Ascend tests + tutorials. The 3 tutorials and 1. 2. 3. val = tl.load(counter_ptr)
libshmem_device.barrier_all() # all vector cores
if sub_vec_id() == 0:
remote = libshmem_device.remote_ptr(counter_ptr, (my_rank + 1) % world_size)
tl.store(remote, val + 1)
libshmem_device.barrier_all() # all vector coresMinor:
Can send a PR with the fixes if that helps. |
|
Heads up: we'll be merging #178 (internal sync) fairly soon — it touches a fair bit of the tree, so you'll likely need to rebase this branch afterwards. Will give you a ping once it lands. |
Got it, no worries. |
Hi Peter, thanks for reviewing our PR.
Minor:
|
Upon further review, there seems to be a problem with running the barrier test when Triton-distributed is paired with a recent version of NPU-IR. Prior versions do not have this issue. We will investigate this further. Also, while both the original and your modified versions of the barrier test pass on my system, moving the barrier outside the guard does make the test run faster end to end so I'll add the change. Thanks! |
Summary
Add Ascend RDMA support and update ACLSHMEM to
v1.5.0.rc1.This PR bumps the ACLSHMEM submodule, updates Ascend tests/tutorials for the corrected
aclshmem_finalize()API, restores the sharedlibshmem_devicedispatch proxy surface, and adds Ascend device wrappers for ACLSHMEM RMA, signaling, team queries, barriers,quiet, andfence.It also updates
ModuleProxy.dispatchso proxied Triton builtins advertise_semanticin their generated wrapper signatures. This is required for the Ascend path becausetriton-ascendfollows Triton 3.5-style codegen, which only injects_semanticwhen it is present in the callable signature. The proxy forwards_semanticonly to backend methods that accept it, preserving CUDA, HIP, and MACA compatibility.Changes
3rdparty/shmemto ACLSHMEMv1.5.0.rc1.aclshmem_finialize()usages withaclshmem_finalize().libshmem_devicedispatch proxy API by:_semanticparameters from dispatch stubsModuleProxy.dispatchto:_semantic=Nonein generated wrapper signatures_semanticonly when the selected backend method declares itteam_my_pe,team_n_pes,team_translate_pebarrier,barrier_vecgetmem,putmem,getmem_nbi,putmem_nbiputmem_signal,putmem_signal_nbi,signal_op,signal_wait_untilquiet,fencedistpytest marker registration.Testing
Added Ascend distributed tests for:
barrier_allputmem/putmem_nbigetmem/getmem_nbisignal_opsignal_wait_untilNew test files:
python/triton_dist/test/ascend/test_barrier_ops.pypython/triton_dist/test/ascend/test_put_get_mem.pypython/triton_dist/test/ascend/test_signal_op.pyThese cover ACLSHMEM team/world barriers, vector barriers, sub-team participation, blocking and non-blocking RMA with
quiet, signal set/wait behavior, and rank-to-rank ping-pong signaling.Notes
ModuleProxy.dispatchcarries the_semanticcompatibility fix centrally, avoiding_semanticparameters in every sharedlibshmem_devicedispatch stub.RMA_DTYPES, with suffixes mapped throughDTYPE_TO_KERNEL_SUFFIX.libshmempath because ACLSHMEM device symbols are handled by AscendNPU-IR rather than a separate bitcode library.