Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
39b7e43
[rocshmem] gda: refactor QueuePair class
omor1 Jun 4, 2026
962f65e
[rocshmem] gda: refactor QueuePairBNXT
omor1 Jun 5, 2026
6d2b8e1
[rocshmem] gda: fix building w/multiple providers & w/o generic provider
omor1 Jun 5, 2026
148b526
[rocshmem] gda: fix invalid memory accesses from QueuePairBNXT refactor
omor1 Jun 6, 2026
3f8a04c
[rocshmem] gda: QueuePairGeneric -> QueuePairMux, GDA_GENERIC -> GDA_MUX
omor1 Jun 8, 2026
c9bc963
[rocshmem] gda: consistent enum order for ATOMIC_CS & ATOMIC_FA opcodes
omor1 Jun 9, 2026
f6a4c5d
[rocshmem] gda: refactor QueuePairIONIC
omor1 Jun 9, 2026
5933898
[rocshmem] bitcode: add QueuePairMux (GDA_MUX) sources
omor1 Jun 9, 2026
f81430f
[rocshmem] gda/ionic: fix QueuePairIONIC build issues
omor1 Jun 9, 2026
922998b
[rocshmem] gda/ionic: missing <new> header for placement-new
omor1 Jun 12, 2026
28cab96
[rocshmem] gda: rebase fixes
omor1 Jun 13, 2026
8cf74b7
[rocshmem] gda: use constmem.gda_provider in QueuePairMux
omor1 Jun 13, 2026
b57df63
[rocshmem] gda: explicit lkey/rkey parameters in QP post_wqe_rma/amo
omor1 Jun 24, 2026
c50c350
[rocsmem] gda: make all local constexpr variables static
omor1 Jun 24, 2026
05ec71d
[rocshmem] gda: minor doxygen formatting
omor1 Jun 24, 2026
e6c6083
[rocshmem] gda: minor function signature reformatting
omor1 Jun 24, 2026
695109b
[rocshmem] gda: new posting option/optimization parameter interface
omor1 Jun 30, 2026
c648e68
docs(rocshmem): [gda] fix typo in comments
omor1 Jun 30, 2026
34f1616
fix(rocshmem): [gda] guard against invalid opcodes in mux provider
omor1 Jul 1, 2026
abb76b5
fix(rocshmem): [gda] prevent UB in QueuePairMux self move-assignment
omor1 Jul 2, 2026
fadd862
Revert "[rocshmem] gda/mlx5: remove mlx5 code from generic GDABackend…
omor1 Jul 7, 2026
06c325d
style(rocshmem): [gda] rename QueuePairSHMEM<XYZ>::atomic_add_nbi to …
omor1 Jul 8, 2026
815a9d0
style(rocshmem): [gda] rename atomic_cas_nbi_nofetch to atomic_cas_no…
omor1 Jul 8, 2026
c454162
style(rocshmem): [gda] rename QueuePairSHMEM<XYZ>::atomic_cas to atom…
omor1 Jul 8, 2026
21f0503
style(rocshmem): [gda] rename post_wqe_amo(value, cond) to (swap_add,…
omor1 Jul 8, 2026
b646152
fix(rocshmem): [gda] remove unused QueuePairIONIC::print_cqe_error
omor1 Jul 8, 2026
6da6c27
style(rocshmem): [gda] change order in queue_pair_<provider>.cpp to r…
omor1 Jul 8, 2026
c0e1581
fix(rocshmem): [gda] restore missing __noinline__, __forceinline__
omor1 Jul 14, 2026
6b62b2a
chore(rocshmem): [gda] call mlx5_devx_qp::dump from initialize_gpu_qp
omor1 Jul 20, 2026
cdb065f
fix(rocshmem): [gda] restore GDABackend::host_qps, hipMemcpy(gda_qps,…
omor1 Jul 22, 2026
5552c56
refactor(rocshmem): [gda] use std::unordered_map for buffer registration
omor1 Jul 22, 2026
b99a9dd
refactor(rocshmem): [gda] track buffer_info entries with freelist
omor1 Jul 22, 2026
693ac68
perf(rocshmem): [gda] annotate some expected-true branches as [[likely]]
omor1 Jul 22, 2026
b86151b
fix(rocshmem): [gda] restore QueuePair put/get/amo explicit lkey/rkey…
omor1 Jul 23, 2026
6100b2c
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Jul 28, 2026
3370b88
Revert "Revert "[rocshmem] gda/mlx5: remove mlx5 code from generic GD…
omor1 Jul 28, 2026
27c8eae
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Jul 28, 2026
e2fe760
fix(rocshmem): [gda] build fixes after develop merge
omor1 Jul 28, 2026
d3ed8c4
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Jul 29, 2026
818b5a8
fix(rocshmem): [gda] use implicit raddr translation in internal_amo*
omor1 Jul 29, 2026
17b95e8
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Jul 29, 2026
ee6d28f
revert(rocshmem): [gda] revert bnxt inline threshold to 8B
omor1 Jul 31, 2026
2770221
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Jul 31, 2026
66d377c
fix(rocshmem): [gda] __host__ __device__ deduction guide for Clang < 22
omor1 Aug 6, 2026
0dd12d5
fix(rocshmem): [gda] __host__ __device__ deduction guide for Clang < …
omor1 Aug 6, 2026
f9e8d01
fix(rocshmem): [gda] use LOG_ERROR_ABORT for __host__ mux function in…
omor1 Aug 11, 2026
503320d
chore(rocshmem): [gda] indicate that non-blocking AMOs are not yet im…
omor1 Aug 11, 2026
6f5d60e
fix(rocshmem): [gda] remove alltoallv raddr calculation
omor1 Aug 12, 2026
adca6af
refactor(rocshmem): [gda] move queue_pair_mlx5.cpp => queue_pair_mlx5…
omor1 Aug 13, 2026
2861b73
refactor(rocshmem): [gda] move queue_pair_bnxt.cpp => queue_pair_bnxt…
omor1 Aug 13, 2026
e96ad4d
refactor(rocshmem): [gda] move queue_pair_ionic.cpp => queue_pair_ion…
omor1 Aug 13, 2026
79b14a9
fix(rocshmem): [gda] user symmetric buffer lkey/rkey endianness
omor1 Aug 15, 2026
b092106
refactor(rocshmem): [gda] move queue_pair_mux.cpp => queue_pair_mux.hpp
omor1 Aug 13, 2026
aa34eb8
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Aug 16, 2026
762a5b7
fix(rocshmem): [gda] adapt direct QP testers from #9551 to QP refactor
omor1 Aug 17, 2026
69e170e
refactor(rocshmem): [gda] split QueuePairBase into QueuePair{Host,Dev…
omor1 Aug 20, 2026
eb3daab
perf(rocshmem): [gda] optimize bnxt_device_sq layout
omor1 Aug 20, 2026
fc28755
refactor(rocshmem): [gda] QpSymmEntry => SymmBufferInfo in queue_pair…
omor1 Aug 20, 2026
fdd314d
fix(rocshmem): [gda] fix build -DGDA_MUX=OFF
omor1 Aug 21, 2026
71935fb
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Aug 21, 2026
af76ed7
feat(rccl): [gin/gda] move to new rocSHMEM QueuePair API
omor1 Aug 25, 2026
d79b6bf
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Aug 25, 2026
ec0e66d
fix(rccl): [gin/gda] remove QP bitcode files link
omor1 Aug 25, 2026
83c6afb
fix(rccl-tests): adapt GIN GDA factory test to QP refactor
omor1 Aug 25, 2026
0c529c7
fix(rccl): [gin/gda] convert LKeys & RKeys to GDA provider endianness
omor1 Aug 25, 2026
2ea865b
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Aug 25, 2026
26209c2
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Aug 31, 2026
12e4c56
fix(rccl): add missing GIN GDA replacement header to SRC_FILES
omor1 Sep 2, 2026
8ee588f
fix(rccl): [gin/gda] copy rocshmem_config.h into tree during build
omor1 Sep 2, 2026
377120c
fix(rccl): add_dependencies(device_linker_build copy_rocshmem_headers)
omor1 Sep 2, 2026
d603e96
docs(rccl): [gin/gda] add log.hpp to documented replacement headers
omor1 Sep 2, 2026
08529d3
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Sep 2, 2026
67c879f
fix(rocshmem): [gda] adapt tile operations to new QueuePair API
omor1 Sep 2, 2026
13fc99b
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Sep 2, 2026
c7dac21
fix(rocshmem): [gda] conflicting definition of ROCSHMEM_SUCCESS in to…
omor1 Sep 3, 2026
9110d64
fix(rccl): [gin/gda] missing #include <gda/gda_enums.hpp>
omor1 Sep 3, 2026
a664820
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Sep 3, 2026
ce8e5fd
fix(rccl): [gin] [cmake] set rocshmem_static_ROOT CMake var to ${ROCS…
omor1 Sep 9, 2026
c8d5582
chore(rocshmem): [gda] remove commented-out code
omor1 Sep 10, 2026
1f1bf31
test(rocshmem): [gda] add QueuePairMock type for mocking QueuePair ob…
omor1 Sep 10, 2026
8ca80f5
test(rccl): [gin/gda] use rocshmem::QueuePairMock in GIN GDA test
omor1 Sep 10, 2026
6751e9b
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Sep 10, 2026
4fc5454
test(rccl): [gin/gda] add QueuePair mock obj header to ROCSHMEM_SOURC…
omor1 Sep 10, 2026
4f58d9f
test(rccl): [gin] prefer RCCL GDA headers over rocSHMEM
omor1 Sep 10, 2026
19e784f
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Sep 10, 2026
3df0268
fix(rccl,rocshmem): fix several typos
omor1 Sep 12, 2026
264cb11
fix(rccl,rocshmem): [gda] fix several missing non-void returns
omor1 Sep 12, 2026
f3be1a7
chore(rccl): [gin] use same license in ibv_core.hpp as ibvcore.h
omor1 Sep 12, 2026
b2b297e
chore(rccl,rocshmem): [gin] misc header-related maint/fix
omor1 Sep 12, 2026
85ace33
refactor(rccl,rocshmem): [gin] move GDA_<vendor>_VENDOR_ID to gda_enu…
omor1 Sep 12, 2026
c25364b
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Sep 12, 2026
8b07bf2
style(rocshmem): [gda] fix indentation in nested switch 'default' case
omor1 Sep 12, 2026
da77728
fix(rocshmem): [gda] missing <cassert> includes
omor1 Sep 13, 2026
90e6926
test(rccl): [gin/gda] remove unnecessary GDA_QUEUEPAIR_MOCK define
omor1 Sep 13, 2026
059fa4c
chore(rccl,rocshmem): [gin/gda] [gda] address some minor nits
omor1 Sep 13, 2026
5d6a272
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Sep 17, 2026
ed7bc71
fix(rocshmem): [gda/ionic] add missing includes in backend_gda_ionic.cpp
omor1 Sep 17, 2026
38cda73
docs(rccl): [gin/gda] document that RCCL uses a stub rocshmem::FreeList
omor1 Sep 17, 2026
934df51
docs(rocshmem): update CHANGELOG.md for GDA QueuePair refactor
omor1 Sep 17, 2026
ceb2e66
docs(rccl): update CHANGELOG.md for GIN rocSHMEM GDA QueuePair refactor
omor1 Sep 17, 2026
a133380
fix(rocshmem): [gda] use aligned_alloc for host QueuePair array
omor1 Sep 17, 2026
5835271
perf(rccl): [gin/gda] use runtime hasSignal branch for RingDB
omor1 Sep 18, 2026
88401e7
docs(rocshmem): [gda] correct DoxyGen template param name
omor1 Sep 18, 2026
788079c
docs(rocshmem): [gda] indicate rocshmem::QueuePairOption namespace end
omor1 Sep 18, 2026
fba3e5d
refactor(rocshmem): [gda] QueuePairMux::invalid_provider helper function
omor1 Sep 18, 2026
4011fc8
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Sep 18, 2026
1c66a50
fix(rccl): [gin/gda] avoid conflicting BIT macro definitions
omor1 Sep 18, 2026
6460df3
chore(rocshmem): [gda/mlx5] remove unused gda_mlx5_wqe_rma::can_inline
omor1 Sep 18, 2026
2b442fe
refactor(rocshmem): [gda] type trait for PostOpt defaults
omor1 Sep 19, 2026
dc9a02e
fix(rocshmem): [gda] constrain PostOpt constructor
omor1 Sep 19, 2026
e1c4609
refactor(rocshmem): [gda] consolidate generic QP init info
omor1 Sep 19, 2026
2e15c35
style(rocshmem): [gda] fix minor spacing issues
omor1 Sep 19, 2026
ea43561
chore(rocshmem): [gda] use updated license format in new files
omor1 Sep 22, 2026
8e3c26c
chore(rccl): [gin/gda] use updated license format in new files
omor1 Sep 22, 2026
79bdee2
rocshmem(core): [gda] add notice for file COPYING in redistributed he…
omor1 Sep 22, 2026
ff9360d
Merge branch 'develop' into users/omor1/rocshmem/refactor_gda_qp
omor1 Sep 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions projects/rccl-tests/src/gin_rocshmem_gda_factory_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <cassert>

#include <gin/gin_rocshmem_gda_factory.h>
#include <nccl_device/gin/rocshmem_gda/queue_pair_device.h>
#include <nccl_device/gin/rocshmem_gda/gda/queue_pair_provider.hpp>
Comment thread
omor1 marked this conversation as resolved.
Resolved
Comment thread
omor1 marked this conversation as resolved.
Resolved

#define HIP_CHECK(cmd) do { \
hipError_t e = (cmd); \
Expand Down Expand Up @@ -54,7 +54,9 @@ __global__ void gin_put_kernel(rocshmem::QueuePair **qps,
rocshmem::ActiveWFInfo wf_info(peer, rocshmem::ThreadScope::thread);
printf("gin_put_kernel: peer=%d dst=%p src=%p bytes=%zu rkey=0x%x lkey=0x%x\n",
peer, dst, src, nbytes, dst_rkey, src_lkey);
qps[peer]->put_nbi(dst, dst_rkey, src, src_lkey, nbytes, wf_info);
uintptr_t dst_raddr = reinterpret_cast<uintptr_t>(dst);
uintptr_t src_laddr = reinterpret_cast<uintptr_t>(src);
qps[peer]->put_nbi(dst_raddr, dst_rkey, src_laddr, src_lkey, nbytes, wf_info);
printf("gin_put_kernel: put posted, calling quiet\n");
qps[peer]->quiet(wf_info);
printf("gin_put_kernel: quiet done\n");
Expand All @@ -69,7 +71,8 @@ __global__ void gin_atomic_kernel(rocshmem::QueuePair **qps,
rocshmem::ActiveWFInfo wf_info(peer, rocshmem::ThreadScope::thread);
printf("gin_atomic_kernel: peer=%d addr=%p rkey=0x%x val=%lld\n",
peer, remote_addr, rkey, (long long)value);
qps[peer]->atomic_add(remote_addr, rkey, value, wf_info);
uintptr_t raddr = reinterpret_cast<uintptr_t>(remote_addr);
qps[peer]->atomic_add(raddr, rkey, value, wf_info);
printf("gin_atomic_kernel: atomic posted, calling quiet\n");
qps[peer]->quiet(wf_info);
printf("gin_atomic_kernel: quiet done\n");
Expand All @@ -85,11 +88,15 @@ __global__ void gin_put_signal_kernel(rocshmem::QueuePair **qps,
int peer) {
if (threadIdx.x == 0 && blockIdx.x == 0) {
rocshmem::ActiveWFInfo wf_info(peer, rocshmem::ThreadScope::thread);
static constexpr auto post_options = rocshmem::PostOpt{rocshmem::RingDB<false>};
printf("gin_put_signal: peer=%d put dst=%p rkey=0x%x src=%p lkey=0x%x bytes=%zu\n",
peer, dst, dst_rkey, src, src_lkey, nbytes);
qps[peer]->put_nbi(dst, dst_rkey, src, src_lkey, nbytes, wf_info, /*ring_db=*/false);
uintptr_t dst_raddr = reinterpret_cast<uintptr_t>(dst);
uintptr_t src_laddr = reinterpret_cast<uintptr_t>(src);
uintptr_t signal_raddr = reinterpret_cast<uintptr_t>(signal_addr);
qps[peer]->put_nbi(dst_raddr, dst_rkey, src_laddr, src_lkey, nbytes, wf_info, post_options);
printf("gin_put_signal: atomic signal=%p rkey=0x%x\n", signal_addr, signal_rkey);
qps[peer]->atomic_add(signal_addr, signal_rkey, 1, wf_info);
qps[peer]->atomic_add(signal_raddr, signal_rkey, 1, wf_info);
printf("gin_put_signal: calling quiet\n");
qps[peer]->quiet(wf_info);
printf("gin_put_signal: done\n");
Expand Down
1 change: 1 addition & 0 deletions projects/rccl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Full documentation for RCCL is available at [https://rccl.readthedocs.io](https:
* Multiple GIN proxy progress threads via `NCCL_GIN_PROXY_NTHREADS`.
* Enabled hierarchical Copy Engine `ncclAllGather` and `ncclAlltoAll` on multi-node communicators: the intra-node phase runs over SDMA/CE across the LSA team and the inter-node phase over one-sided RMA through the CPU (GIN) proxy. The path is off by default and takes two opt-ins: `NCCL_CTA_POLICY=2` (equivalently `config.CTAPolicy = NCCL_CTA_POLICY_ZERO`), and symmetric registration of both the send and the receive buffer through `ncclCommWindowRegister`. On architectures other than gfx1250 (MI450) a third is needed, `NCCL_CUMEM_ENABLE=1`, because symmetric memory depends on cuMem and cuMem auto-detection enables itself only on gfx1250. `NCCL_GIN_ENABLE`, `NCCL_NUM_RMA_CTX`, `NCCL_WIN_ENABLE` and `NCCL_DMABUF_ENABLE` need no change, since their defaults already qualify; the inter-node rail draws from the internal RMA context pool (`NCCL_NUM_RMA_INT_CTX`, default 4) rather than the user-addressable contexts, so `numRmaCtx` only has to stay above zero. Selection also requires an available GIN backend and the same number of ranks on every node; communicators that do not qualify keep using the kernel path. Validated for correctness and path selection from 1 to 32 nodes.
* Added `ncclGinFenceLevel` barrier semantics on the Anvil SDMA GIN backend (`NCCL_GIN_TYPE=7`). `gin.get`, `flushAsync` and `wait` are implemented instead of trapping, and a barrier's signal is now ordered behind the payload on the peer's SDMA queue, so `Put`, `Get` and the default `Put | Get` fences drain what they promise. `Put` covers a rank's puts to itself, and `ncclGinAllContexts` fences every GIN context. Single-node validated on gfx950.
* Removed GIN rocSHMEM GDA dependency on rocSHMEM GDA bitcode: GIN rocSHMEM GDA is now header-only. The CMake `roc::rccl` target provides the required include directories in its `INSTALL_INTERFACE` property.

### Changed
* **Breaking: `NCCL_GIN_TYPE` values for AMD backends are not compatible with 2.30.7.** NCCL 2.31 inserted EFA GDA at value 5, so rocSHMEM GDA moved 5→6 and Anvil SDMA moved 6→7. The IB proxy remains `2`. Jobs that still set `NCCL_GIN_TYPE=6` now select rocSHMEM GDA, not Anvil SDMA. See `src/gin/README.md`.
Expand Down
17 changes: 10 additions & 7 deletions projects/rccl/cmake/DeviceLinker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ foreach(DL_GPU_TARGET ${DL_GPU_TARGETS})
if((ENABLE_ROCSHMEM OR ENABLE_ROCSHMEM_GIN) AND TARGET rocshmem_static)
add_dependencies(${_dev_target} rocshmem_static)
endif()
if(ENABLE_ROCSHMEM_GIN AND TARGET copy_rocshmem_headers)
add_dependencies(${_dev_target} copy_rocshmem_headers)
endif()
# Pass rocshmem device bitcode to per-kernel compiles so rocshmem device
# symbols resolve during the per-arch device.elf link step.
# ENABLE_ROCSHMEM: rocshmem_n_pes, alltoall_wg, etc.
Expand Down Expand Up @@ -1101,13 +1104,7 @@ if(GENERATE_SYM_KERNELS)

add_custom_command(
OUTPUT ${_qp_bc}
COMMAND ${_llvm_link}
${_bc_dir}/queue_pair.bc
${_bc_dir}/queue_pair_mlx5.bc
${_bc_dir}/queue_pair_bnxt.bc
${_bc_dir}/queue_pair_ionic.bc
${_cm_bc}
-o ${_qp_raw}
COMMAND ${_llvm_link} ${_cm_bc} -o ${_qp_raw}
COMMAND ${_llvm_dis} -o ${_qp_raw}.ll ${_qp_raw}
COMMAND grep -v -E "@llvm[.]compiler[.]used|@__hip_cuid_"
${_qp_raw}.ll > ${_qp_raw}.clean.ll
Expand Down Expand Up @@ -1164,6 +1161,9 @@ add_custom_target(device_linker_build ALL
DEPENDS ${COMMON_FAT_OBJ} ${ONERANK_FAT_OBJ} ${COLLECTIVES_FAT_OBJ} ${DIAG_P2P_FAT_OBJ} ${DDA_ALL_REDUCE_IPC_FAT_OBJ} ${DDA_REDUCE_SCATTER_IPC_FAT_OBJ} ${DDA_ALL_GATHER_IPC_FAT_OBJ} ${DDA_ALLTOALL_IPC_FAT_OBJ} ${DDA_ALL_REDUCE_FABRIC_FAT_OBJ} ${DDA_ALL_REDUCE_FABRIC_LL_FAT_OBJ} ${DDA_ALL_REDUCE_FABRIC_LL128_FAT_OBJ} ${DDA_REDUCE_SCATTER_FABRIC_FAT_OBJ} ${DDA_ALL_GATHER_FABRIC_FAT_OBJ} ${DDA_ALL_GATHER_FABRIC_LL_FAT_OBJ} ${DDA_ALL_GATHER_FABRIC_LL128_FAT_OBJ} ${DDA_ALLTOALL_FABRIC_FAT_OBJ} ${DDA_ALLTOALL_FABRIC_LL_FAT_OBJ} ${DDA_ALLTOALL_FABRIC_LL128_FAT_OBJ} ${DDA_REDUCE_SCATTER_FABRIC_LL_FAT_OBJ} ${DDA_REDUCE_SCATTER_FABRIC_LL128_FAT_OBJ} ${CE_REDUCE_FAT_OBJS} ${SYM_FAT_OBJS} ${GIN_ALLTOALL_SDMA_FAT_OBJ} ${GIN_ALLREDUCE_SDMA_FAT_OBJ} ${RCCL_EP_FAT_OBJ} ${DEVICE_ELF_SYMLINKS}
)
add_dependencies(device_linker_build hipify_all copy_nccl_device_headers)
if(ENABLE_ROCSHMEM_GIN AND TARGET copy_rocshmem_headers)
add_dependencies(device_linker_build copy_rocshmem_headers)
endif()
if((ENABLE_ROCSHMEM OR ENABLE_ROCSHMEM_GIN) AND TARGET rocshmem_static)
# The fat objects above include GIN device headers, which pull in rocSHMEM
# headers installed to ext/rocshmem/include by the ExternalProject.
Expand Down Expand Up @@ -1202,3 +1202,6 @@ set(DEVICE_LINKER_OBJECTS
# ===========================================================================
add_custom_target(device_ir DEPENDS ${ALL_IR_FILES})
add_dependencies(device_ir hipify_all copy_nccl_device_headers)
if(ENABLE_ROCSHMEM_GIN AND TARGET copy_rocshmem_headers)
add_dependencies(device_ir copy_rocshmem_headers)
endif()
24 changes: 24 additions & 0 deletions projects/rccl/cmake/ROCSHMEM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ function(add_rocshmem_targets)
# -----------------------------------------------------------------
if(ROCSHMEM_INSTALL_DIR)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# Set rocshmem_static_ROOT; variable read on enter, so must be set BEFORE find_package()
if(NOT rocshmem_static_ROOT)
set(rocshmem_static_ROOT "${ROCSHMEM_INSTALL_DIR}")
endif()
find_package(rocshmem_static)
if(rocshmem_static_FOUND)
set(ROCSHMEM_INCLUDE_DIR "${ROCSHMEM_INCLUDE_DIR}" PARENT_SCOPE)
Expand Down Expand Up @@ -158,3 +162,23 @@ function(add_rocshmem_targets)
set(ROCSHMEM_SOURCE_DIR "${ROCSHMEM_SOURCE_DIR}" PARENT_SCOPE)

endfunction()

# copy files in the list-valued variable ${FILE_LIST_VAR} from ${SRC_DIR} to ${DST_DIR}
# appends the destination file location to the list-valued variable ${OUTPUT_LIST_VAR}
function(copy_files FILE_LIST_VAR SRC_DIR DST_DIR OUTPUT_LIST_VAR)
foreach(file_name ${${FILE_LIST_VAR}})
set(src_file "${SRC_DIR}/${file_name}")
set(dst_file "${DST_DIR}/${file_name}")
get_filename_component(dst_file_dir "${dst_file}" DIRECTORY)
add_custom_command(
OUTPUT "${dst_file}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${dst_file_dir}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${src_file}" "${dst_file}"
DEPENDS "${src_file}"
COMMENT "Copying ${src_file} -> ${dst_file}"
VERBATIM
)
list(APPEND ${OUTPUT_LIST_VAR} "${dst_file}")
endforeach()
set(${OUTPUT_LIST_VAR} ${${OUTPUT_LIST_VAR}} PARENT_SCOPE)
endfunction()
92 changes: 91 additions & 1 deletion projects/rccl/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ set(SRC_FILES
include/nccl_device/gin/proxy/gin_proxy_device_host_common.h
include/nccl_device/gin/rocshmem_gda/gin_rocshmem_device_host_common_gda.h
include/nccl_device/gin/rocshmem_gda/gin_rocshmem_gda.h
include/nccl_device/gin/rocshmem_gda/queue_pair_device.h
include/nccl_device/gin_barrier.h
include/nccl_device/impl/barrier__funcs.h
include/nccl_device/impl/barrier__types.h
Expand Down Expand Up @@ -594,6 +593,13 @@ if(ENABLE_ROCSHMEM_GIN)
src/algorithms/gin/sdma/gin_alltoall_sdma.cu
src/algorithms/gin/sdma/gin_all_reduce_sdma.cu
)
list(APPEND SRC_FILES
src/include/nccl_device/gin/rocshmem_gda/log.hpp
src/include/nccl_device/gin/rocshmem_gda/util.hpp
src/include/nccl_device/gin/rocshmem_gda/containers/free_list.hpp
src/include/nccl_device/gin/rocshmem_gda/gda/ibv_core.hpp
src/include/nccl_device/gin/rocshmem_gda/rocshmem/rocshmem_common.hpp
)
endif()

if(USE_AMDSMI)
Expand Down Expand Up @@ -1055,6 +1061,90 @@ if (ENABLE_ROCSHMEM OR ENABLE_ROCSHMEM_GIN)
endif()
endif()
endif()

if (ENABLE_ROCSHMEM_GIN)
# Ensure we see our copied headers before rocSHMEM's
target_include_directories(rccl BEFORE PRIVATE ${PROJECT_BINARY_DIR}/include/nccl_device/gin/rocshmem_gda)
Comment thread
omor1 marked this conversation as resolved.
Resolved

# Need to add the GIN GDA directory to the public interface:
# internal rocSHMEM headers assume that the source directory is in the include search path
target_include_directories(rccl BEFORE INTERFACE
Comment thread
omor1 marked this conversation as resolved.
Resolved
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/nccl_device/gin/rocshmem_gda>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/nccl_device/gin/rocshmem_gda>
Comment thread
omor1 marked this conversation as resolved.
Resolved
)

# Add target for copying the rocSHMEM headers
add_custom_target(copy_rocshmem_headers)
add_dependencies(rccl copy_rocshmem_headers)

if (ROCSHMEM_INCLUDE_DIR)
# Copy rocSHMEM public include headers (primarily rocshmem_config.h) into RCCL
set(ROCSHMEM_INCLUDE_HEADERS rocshmem/rocshmem_config.h)
copy_files(
ROCSHMEM_INCLUDE_HEADERS
"${ROCSHMEM_INCLUDE_DIR}"
"${PROJECT_BINARY_DIR}/include/nccl_device/gin/rocshmem_gda"
GIN_GDA_ROCSHMEM_INCLUDE_HEADERS
)
add_custom_target(copy_rocshmem_include_headers DEPENDS ${GIN_GDA_ROCSHMEM_INCLUDE_HEADERS})
# Ensure rocSHMEM is fully built/installed before copying installed headers
if (TARGET rocshmem_ext)
add_dependencies(copy_rocshmem_include_headers rocshmem_ext)
endif()
add_dependencies(copy_rocshmem_headers copy_rocshmem_include_headers)
endif()

if (ROCSHMEM_SOURCE_DIR)
# Copy rocSHMEM QueuePair device headers into RCCL
set(ROCSHMEM_SOURCE_HEADERS
# Queue Pair core
gda/queue_pair/queue_pair_common.hpp
gda/queue_pair/queue_pair_option.hpp
gda/queue_pair/queue_pair_interface.hpp
gda/queue_pair/queue_pair_shmem.hpp
gda/queue_pair/queue_pair_device.hpp
gda/queue_pair_provider.hpp
# GDA_MUX (Multiplexing provider)
gda/queue_pair_mux.hpp
# GDA_IONIC (AMD Pensando IONIC RDMA provider)
gda/ionic/queue_pair_ionic.hpp
gda/ionic/provider_gda_ionic.hpp
gda/ionic/ionic_dv.h
Comment thread
omor1 marked this conversation as resolved.
Resolved
gda/ionic/ionic_fw.h
# GDA_BNXT (Broadcom BNXT RDMA provider)
gda/bnxt/queue_pair_bnxt.hpp
gda/bnxt/provider_gda_bnxt.hpp
gda/bnxt/bnxt_re_dv.h
gda/bnxt/bnxt_re_hsi.h
# GDA_MLX5 (Mellanox MLX5 RDMA provider)
gda/mlx5/queue_pair_mlx5.hpp
gda/mlx5/provider_gda_mlx5.hpp
gda/mlx5/mlx5dv_core.hpp
gda/mlx5/mlx5_ifc_core.hpp
# GDA_QUEUEPAIR_MOCK (QueuePair mock object)
gda/queue_pair/queue_pair_mock.hpp
# rocSHMEM internals / miscellaneous
gda/endian.hpp
gda/gda_enums.hpp
bit.hpp
constmem.hpp
constants.hpp
)
copy_files(
ROCSHMEM_SOURCE_HEADERS
"${ROCSHMEM_SOURCE_DIR}/src"
"${PROJECT_BINARY_DIR}/include/nccl_device/gin/rocshmem_gda"
GIN_GDA_ROCSHMEM_SOURCE_HEADERS
)
add_custom_target(copy_rocshmem_source_headers DEPENDS ${GIN_GDA_ROCSHMEM_SOURCE_HEADERS})
add_dependencies(copy_rocshmem_headers copy_rocshmem_source_headers)
endif()

# Add rule to install ibvcore.h so that it can be found by ibv_core.hpp
rocm_install(FILES ${HIPIFY_DIR}/src/include/ibvcore.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nccl_device/gin/rocshmem_gda)
endif()

if (ENABLE_ROCSHMEM)
target_link_libraries(rccl PRIVATE ${IBVERBS})
endif()
Expand Down
Loading
Loading