Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions projects/rccl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Full documentation for RCCL is available at [https://rccl.readthedocs.io](https:
* Fixed a 15 to 30% `ncclScatter` bandwidth loss from 16 MB upward on multi-node AINIC jobs, caused by the move to two network channels per peer (for example on 4 nodes of 8 GPUs). Scatter now uses and connects the most channels per peer whose flows still fit the P2P channel pool. Point-to-point operations and the other collectives keep their channel count.
* Fixed intermittent data corruption in multi-node collectives, seen as out-of-bounds values in 8-node AllToAll, on hosts that use GPU Direct RDMA through peermem. Since RCCL 2.30.4 the GDR flush scratchpad was registered only through dma-buf, so on peermem hosts the flush degraded to a single RDMA read of the receive buffer, which does not order earlier relaxed-ordering writes. The scratchpad is now also registered through peermem, restoring the strictly ordered RDMA write that precedes the flush read.
* Fixed `ncclCommAbort` and `ncclCommRevoke` hanging when a DDA collective (IPC on gfx942/gfx950, fabric LL/LL128/VMM on gfx1250) was waiting on a peer that never joined. DDA kernels now observe the communicator abort flag while waiting. A parent communicator shrunk with `NCCL_SHRINK_ABORT` no longer uses DDA for later collectives.
* Fixed wrong results and hangs in application kernels that use the GIN device API, such as the `07_kernel_fusion` GIN and hybrid RMSNorm examples. `nccl_device/coop.h` selected `__syncwarp` from `ROCM_VERSION`, which only RCCL's own build defines, so in application code the thread and warp cooperative groups synchronized the whole block with `__syncthreads()`. The GIN barrier calls them from a subset of threads, which left the block's waves out of step. The headers now fall back to the HIP version when `ROCM_VERSION` is not defined.
* Fixed FP8 E4M3 and E5M2 `ncclAvg` returning wrong values for every element of every reduction collective on gfx942, and on architectures that use the software FP8 fallback. The `1/nRanks` scale was packed as an FP8 value in the host's OCP encoding, which those devices decode as FNUZ, so every result came out half as large. The scale is now carried as `float` on all architectures, which also keeps it exact at rank counts FP8 cannot represent: in OCP E4M3, `1/384` was off by 25% and `1/1024` rounded to zero. Single-rank FP8 reductions on gfx942 no longer fail to launch the `oneRankReduce` kernel, and rccl-tests no longer skips FP8 `avg` for `all_reduce`, `all_reduce_bias` and `reduce`.
* Fixed the GIN plugin never being finalized for a communicator that had connected a GIN backend, leaking the plugin's per-communicator context and leaving its reference count one too high after every `ncclCommDestroy`. `ncclGinHostFinalize` closed the GIN connections and then zeroed the whole `ncclGinState`, so the `ncclGinFinalize` that follows it in `commFree` saw no active backend and skipped the plugin `finalize()` call. Host finalize now clears only the per-connection state and hands the backend records to `ncclGinFinalize`, which finalizes each one on the last shared-resource reference. `commFree` returns the first of a `closeColl` or plugin-finalize error after those frees; if both fail, the `closeColl` error is the one reported. An `ncclRmaProxyFinalize` error still aborts the rest of teardown immediately. On the Anvil SDMA backend (`NCCL_GIN_TYPE=7`) this was one leaked init context per connected communicator.
* Restored topo tuning-model init (`ncclTopoTuneModel`) after the 2.31 `ncclTuningInit` switch so multi-node kernels do not launch with `blockDim.x=0`.
Expand Down
4 changes: 4 additions & 0 deletions projects/rccl/examples/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@
06_device_api/01_allreduce_lsa/c/allreduce_lsa
06_device_api/02_alltoall_gin/c/alltoall_gin
06_device_api/03_alltoall_hybrid/c/alltoall_hybrid
07_kernel_fusion/01_rmsnorm_lsa/c/rmsnorm_lsa
07_kernel_fusion/02_rmsnorm_multimem/c/rmsnorm_multimem
07_kernel_fusion/03_rmsnorm_gin/c/rmsnorm_gin
07_kernel_fusion/04_rmsnorm_hybrid/c/rmsnorm_hybrid
25 changes: 11 additions & 14 deletions projects/rccl/examples/07_kernel_fusion/01_rmsnorm_lsa/c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#

# Include common build rules
include ../../../../../makefiles/common.mk
include ../../../../../makefiles/examples.mk
include ../../../makefiles/rccl_examples.mk

# Target executable
TARGET = rmsnorm_lsa
Expand All @@ -20,18 +19,20 @@ RMSNORM_INC = ../../include
# Build configuration
INCLUDES += -I$(COMMON_INC) -I$(RMSNORM_INC)

# Source files
# Source files (.cu is hipified into $(HIPIFY_DIR) at build time)
SOURCES = main.cu utils.cc
# utils.cc is a shared helper in common/src, compiled per-example into a local
# utils.o so parallel example builds do not race on one shared object.
# vpath NAME DIR tells make to search DIR for the prerequisite NAME, so the
# %.o: %.cc rule below finds utils.cc in $(COMMON_SRC) and builds a local utils.o.
vpath utils.cc $(COMMON_SRC)
OBJECTS = $(SOURCES:.cu=.o)
OBJECTS := $(OBJECTS:.cc=.o)
OBJECTS = $(patsubst %.cu,$(HIPIFY_DIR)/%.cu.o,$(filter %.cu,$(SOURCES))) \
$(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES)))

# Header dependencies (rmsnorm_utils.cuh needed for main.cu)
CU_HEADERS = $(RMSNORM_INC)/rmsnorm_utils.cuh
# Header dependencies (rmsnorm_utils.cuh needed for main.cu). It includes
# <cuda_runtime.h>, so main.cu compiles against its hipified copy.
vpath rmsnorm_utils.cuh $(RMSNORM_INC)
CU_HEADERS = $(HIPIFY_DIR)/rmsnorm_utils.cuh

# Default target
all: $(TARGET)
Expand All @@ -45,9 +46,8 @@ else
endif
@echo "Built target $@"

# Compile CUDA files with rmsnorm header dependency
%.o: %.cu $(CU_HEADERS)
$(NVCC) $(NVCUFLAGS) $(INCLUDES) -c $< -o $@
# Compile the hipified main.cu against the hipified rmsnorm header
$(HIPIFY_DIR)/main.cu.o: $(CU_HEADERS)

# Compile C++ files
%.o: %.cc
Expand All @@ -70,7 +70,7 @@ endif

# Clean build artifacts
clean:
rm -f $(OBJECTS) $(TARGET)
rm -rf $(OBJECTS) $(TARGET) $(HIPIFY_DIR)

# Install target
install: $(TARGET)
Expand All @@ -85,9 +85,6 @@ help:
@echo "This example demonstrates fused computation and communication"
@echo "using Load Store Accessible (LSA) for RMSNorm operations."
@echo ""
@echo "Requirements:"
@echo " - CUDA 12.2 or above"
@echo ""
@echo "Targets:"
@echo " all - Build the example (default)"
@echo " test - Build and run test with all GPUs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ operation within a single GPU kernel.
From this directory:

```shell
make [MPI=1] [MPI_HOME=<path-to-mpi>] [NCCL_HOME=<path-to-nccl>] [CUDA_HOME=<path-to-cuda>]
make [MPI=1] [MPI_HOME=<path-to-mpi>] [RCCL_HOME=<path-to-rccl>] [ROCM_PATH=<path-to-rocm>] [GPU_TARGETS="<gfx-arch> ..."]
```

## Run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#

# Include common build rules
include ../../../../../makefiles/common.mk
include ../../../../../makefiles/examples.mk
include ../../../makefiles/rccl_examples.mk

# Target executable
TARGET = rmsnorm_multimem
Expand All @@ -20,18 +19,20 @@ RMSNORM_INC = ../../include
# Build configuration
INCLUDES += -I$(COMMON_INC) -I$(RMSNORM_INC)

# Source files
# Source files (.cu is hipified into $(HIPIFY_DIR) at build time)
SOURCES = main.cu utils.cc
# utils.cc is a shared helper in common/src, compiled per-example into a local
# utils.o so parallel example builds do not race on one shared object.
# vpath NAME DIR tells make to search DIR for the prerequisite NAME, so the
# %.o: %.cc rule below finds utils.cc in $(COMMON_SRC) and builds a local utils.o.
vpath utils.cc $(COMMON_SRC)
OBJECTS = $(SOURCES:.cu=.o)
OBJECTS := $(OBJECTS:.cc=.o)
OBJECTS = $(patsubst %.cu,$(HIPIFY_DIR)/%.cu.o,$(filter %.cu,$(SOURCES))) \
$(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES)))

# Header dependencies (rmsnorm_utils.cuh needed for main.cu)
CU_HEADERS = $(RMSNORM_INC)/rmsnorm_utils.cuh
# Header dependencies (rmsnorm_utils.cuh needed for main.cu). It includes
# <cuda_runtime.h>, so main.cu compiles against its hipified copy.
vpath rmsnorm_utils.cuh $(RMSNORM_INC)
CU_HEADERS = $(HIPIFY_DIR)/rmsnorm_utils.cuh

# Default target
all: $(TARGET)
Expand All @@ -45,9 +46,8 @@ else
endif
@echo "Built target $@"

# Compile CUDA files with rmsnorm header dependency
%.o: %.cu $(CU_HEADERS)
$(NVCC) $(NVCUFLAGS) $(INCLUDES) -c $< -o $@
# Compile the hipified main.cu against the hipified rmsnorm header
$(HIPIFY_DIR)/main.cu.o: $(CU_HEADERS)

# Compile C++ files
%.o: %.cc
Expand All @@ -70,7 +70,7 @@ endif

# Clean build artifacts
clean:
rm -f $(OBJECTS) $(TARGET)
rm -rf $(OBJECTS) $(TARGET) $(HIPIFY_DIR)

# Install target
install: $(TARGET)
Expand All @@ -85,11 +85,6 @@ help:
@echo "This example demonstrates fused computation and communication"
@echo "using Multimem (LSA) for RMSNorm operations."
@echo ""
@echo "Requirements:"
@echo " - CUDA 12.2 or above"
@echo " - CUDA Compute Capability 9.0 or higher (Hopper H100+)"
@echo " - Multimem support (nLsaTeams == 1)"
@echo ""
@echo "Targets:"
@echo " all - Build the example (default)"
@echo " test - Build and run test with all GPUs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ API (hardware multicast memory operations, SM 9.0+).
From this directory:

```shell
make [MPI=1] [MPI_HOME=<path-to-mpi>] [NCCL_HOME=<path-to-nccl>] [CUDA_HOME=<path-to-cuda>]
make [MPI=1] [MPI_HOME=<path-to-mpi>] [RCCL_HOME=<path-to-rccl>] [ROCM_PATH=<path-to-rocm>] [GPU_TARGETS="<gfx-arch> ..."]
```

## Run
Expand Down
25 changes: 11 additions & 14 deletions projects/rccl/examples/07_kernel_fusion/03_rmsnorm_gin/c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#

# Include common build rules
include ../../../../../makefiles/common.mk
include ../../../../../makefiles/examples.mk
include ../../../makefiles/rccl_examples.mk

# Target executable
TARGET = rmsnorm_gin
Expand All @@ -20,18 +19,20 @@ RMSNORM_INC = ../../include
# Build configuration
INCLUDES += -I$(COMMON_INC) -I$(RMSNORM_INC)

# Source files
# Source files (.cu is hipified into $(HIPIFY_DIR) at build time)
SOURCES = main.cu utils.cc
# utils.cc is a shared helper in common/src, compiled per-example into a local
# utils.o so parallel example builds do not race on one shared object.
# vpath NAME DIR tells make to search DIR for the prerequisite NAME, so the
# %.o: %.cc rule below finds utils.cc in $(COMMON_SRC) and builds a local utils.o.
vpath utils.cc $(COMMON_SRC)
OBJECTS = $(SOURCES:.cu=.o)
OBJECTS := $(OBJECTS:.cc=.o)
OBJECTS = $(patsubst %.cu,$(HIPIFY_DIR)/%.cu.o,$(filter %.cu,$(SOURCES))) \
$(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES)))

# Header dependencies (rmsnorm_utils.cuh needed for main.cu)
CU_HEADERS = $(RMSNORM_INC)/rmsnorm_utils.cuh
# Header dependencies (rmsnorm_utils.cuh needed for main.cu). It includes
# <cuda_runtime.h>, so main.cu compiles against its hipified copy.
vpath rmsnorm_utils.cuh $(RMSNORM_INC)
CU_HEADERS = $(HIPIFY_DIR)/rmsnorm_utils.cuh

# Default target
all: $(TARGET)
Expand All @@ -45,9 +46,8 @@ else
endif
@echo "Built target $@"

# Compile CUDA files with rmsnorm header dependency
%.o: %.cu $(CU_HEADERS)
$(NVCC) $(NVCUFLAGS) $(INCLUDES) -c $< -o $@
# Compile the hipified main.cu against the hipified rmsnorm header
$(HIPIFY_DIR)/main.cu.o: $(CU_HEADERS)

# Compile C++ files
%.o: %.cc
Expand All @@ -70,7 +70,7 @@ endif

# Clean build artifacts
clean:
rm -f $(OBJECTS) $(TARGET)
rm -rf $(OBJECTS) $(TARGET) $(HIPIFY_DIR)

# Install target
install: $(TARGET)
Expand All @@ -85,9 +85,6 @@ help:
@echo "This example demonstrates fused computation and communication"
@echo "using GPU-Initiated Networking (GIN) for RMSNorm operations."
@echo ""
@echo "Requirements:"
@echo " - CUDA 12.2 or above"
@echo ""
@echo "Targets:"
@echo " all - Build the example (default)"
@echo " test - Build and run test with all GPUs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ operation within a single GPU kernel.
From this directory:

```shell
make [MPI=1] [MPI_HOME=<path-to-mpi>] [NCCL_HOME=<path-to-nccl>] [CUDA_HOME=<path-to-cuda>]
make [MPI=1] [MPI_HOME=<path-to-mpi>] [RCCL_HOME=<path-to-rccl>] [ROCM_PATH=<path-to-rocm>] [GPU_TARGETS="<gfx-arch> ..."]
```

## Run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#

# Include common build rules
include ../../../../../makefiles/common.mk
include ../../../../../makefiles/examples.mk
include ../../../makefiles/rccl_examples.mk

# Target executable
TARGET = rmsnorm_hybrid
Expand All @@ -20,18 +19,20 @@ RMSNORM_INC = ../../include
# Build configuration
INCLUDES += -I$(COMMON_INC) -I$(RMSNORM_INC)

# Source files
# Source files (.cu is hipified into $(HIPIFY_DIR) at build time)
SOURCES = main.cu utils.cc
# utils.cc is a shared helper in common/src, compiled per-example into a local
# utils.o so parallel example builds do not race on one shared object.
# vpath NAME DIR tells make to search DIR for the prerequisite NAME, so the
# %.o: %.cc rule below finds utils.cc in $(COMMON_SRC) and builds a local utils.o.
vpath utils.cc $(COMMON_SRC)
OBJECTS = $(SOURCES:.cu=.o)
OBJECTS := $(OBJECTS:.cc=.o)
OBJECTS = $(patsubst %.cu,$(HIPIFY_DIR)/%.cu.o,$(filter %.cu,$(SOURCES))) \
$(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES)))

# Header dependencies (rmsnorm_utils.cuh needed for main.cu)
CU_HEADERS = $(RMSNORM_INC)/rmsnorm_utils.cuh
# Header dependencies (rmsnorm_utils.cuh needed for main.cu). It includes
# <cuda_runtime.h>, so main.cu compiles against its hipified copy.
vpath rmsnorm_utils.cuh $(RMSNORM_INC)
CU_HEADERS = $(HIPIFY_DIR)/rmsnorm_utils.cuh

# Default target
all: $(TARGET)
Expand All @@ -45,9 +46,8 @@ else
endif
@echo "Built target $@"

# Compile CUDA files with rmsnorm header dependency
%.o: %.cu $(CU_HEADERS)
$(NVCC) $(NVCUFLAGS) $(INCLUDES) -c $< -o $@
# Compile the hipified main.cu against the hipified rmsnorm header
$(HIPIFY_DIR)/main.cu.o: $(CU_HEADERS)

# Compile C++ files
%.o: %.cc
Expand All @@ -70,7 +70,7 @@ endif

# Clean build artifacts
clean:
rm -f $(OBJECTS) $(TARGET)
rm -rf $(OBJECTS) $(TARGET) $(HIPIFY_DIR)

# Install target
install: $(TARGET)
Expand All @@ -86,9 +86,6 @@ help:
@echo "using a hybrid approach combining LSA for intra-node and GIN"
@echo "for inter-node communication for RMSNorm operations."
@echo ""
@echo "Requirements:"
@echo " - CUDA 12.2 or above"
@echo ""
@echo "Targets:"
@echo " all - Build the example (default)"
@echo " test - Build and run test with all GPUs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ distributed RMSNorm operation within a single GPU kernel.
From this directory:

```shell
make [MPI=1] [MPI_HOME=<path-to-mpi>] [NCCL_HOME=<path-to-nccl>] [CUDA_HOME=<path-to-cuda>]
make [MPI=1] [MPI_HOME=<path-to-mpi>] [RCCL_HOME=<path-to-rccl>] [ROCM_PATH=<path-to-rocm>] [GPU_TARGETS="<gfx-arch> ..."]
```

## Run
Expand Down
3 changes: 2 additions & 1 deletion projects/rccl/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ full reference.
| `04_user_buffer_registration` | `ncclCommRegister` to pre-register user buffers for faster collectives |
| `05_symmetric_memory` | `ncclCommWindowRegister` symmetric memory windows |
| `06_device_api` | Device-side API (kept as the RCCL-specific examples already present in the project) |
| `07_kernel_fusion` | RMSNorm fused with its communication in a single kernel through the Device API: LSA, Multimem, GIN, and hybrid LSA/GIN. Multimem is not supported on AMD GPUs; the GIN examples need `NCCL_CUMEM_ENABLE=1` and an RDMA NIC (`NCCL_GIN_TYPE=2`) |

## Prerequisites

Expand All @@ -41,7 +42,7 @@ full reference.
From this directory:

```bash
make GPU_TARGETS="gfx942" # build all 01..05 categories
make GPU_TARGETS="gfx942" # build all 01..07 categories
make -C 03_collectives/01_allreduce # build one example
make MPI=1 -C 01_communicators/03_one_device_per_process_mpi
```
Expand Down
8 changes: 7 additions & 1 deletion projects/rccl/examples/makefiles/rccl_examples.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,11 @@ else
$(CXX) $(CXXFLAGS) -x hip $(INCLUDES) -c $< -o $@
endif

# Quoted #includes in hipified sources search HIPIFY_DIR first, so this HIP copy
# shadows the CUDA header. Needs a vpath to the header's directory.
$(HIPIFY_DIR)/%.cuh: %.cuh
@mkdir -p $(dir $@)
$(HIPIFY) -experimental -quiet-warnings $< -o $@.tmp && mv -f $@.tmp $@

# Keep the hipified source so it is not deleted as a make intermediate.
.PRECIOUS: $(HIPIFY_DIR)/%.cu.cpp
.PRECIOUS: $(HIPIFY_DIR)/%.cu.cpp $(HIPIFY_DIR)/%.cuh
5 changes: 2 additions & 3 deletions projects/rccl/src/algorithms/rccl_ep/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ find_path(RCCL_EP_RCCL_INCLUDE_DIR

find_package(hip REQUIRED)

# <nccl_device.h> is version-gated and degrades silently when ROCM_VERSION is
# undefined: coop.h:124 and :154 fall back from __syncwarp() to __syncthreads()
# in ncclCoopTile::sync() and ncclCoopLanes::sync(), and hip_compat.h:63 defines
# <nccl_device.h> is version-gated on ROCM_VERSION: without it, coop.h takes its
# warp-sync gate from HIP_VERSION_MAJOR instead, and hip_compat.h:63 defines
# CU_MEM_LOCATION_TYPE_HOST_NUMA that a ROCm >= 7.12 build already provides.
# RCCL's own build passes -DROCM_VERSION for this exact file
# (cmake/DeviceLinker.cmake:772), so the standalone artifact has to agree or the
Expand Down
Loading
Loading