Profiler improvements * Add events for CUDA kernel start and end. * Allow network plugins to generate profiling events * Enable profiling on a per-operation basis, rather than per-communicator. * Add support for graph capturing. Add implicit launch order * Allow to prevent deadlocks when using multiple NCCL communicators per device by implicitly ordering NCCL operations using the host program order. Disabled by default, set NCCL_LAUNCH_ORDER_IMPLICIT=1 to enable. * Add a complementary mechanism to detect host threads racing to launch to the same device. Enabled by default, set NCCL_LAUNCH_RACE_FATAL=0 to disable. Optimize the PAT algorithm * Separate the computation and execution of PAT steps on different warps, allowing to run up to 16 PAT steps in parallel to significantly accelerate PAT and reduce its linear part. Add support for setting QoS per communicator * Add a new trafficClass field to the communicator configuration, to allow the application to select a particular traffic class for a given communicator. The meaning of the traffic class is network-specific and should be set in accordance with the network configuration. * For the IB/RoCE plugin, existing config variables such as NCCL_IB_SL and NCCL_IB_TC take precedence. Allow to enable GPU Direct RDMA specifically on C2C platforms * Disabled by default, set NCCL_NET_GDR_C2C=1 to enable. Do not disable user buffer registration unless PXN is really used * Only disable UB when a communicator has more than one rank per node on any node. RAS subsystem improvements * Report operation counts separately for each collective operation type. * Provide details about missing communicator ranks and reliably distinguish ranks that are no longer a given communicator's members (now reported as NOCOMM) from those that failed to respond. Add support for timestamps to NCCL diagnostic messages * On by default for WARN messages; NCCL_DEBUG_TIMESTAMP_LEVELS can be used to enable them for other debug levels as well. * The format can be changed using the NCCL_DEBUG_TIMESTAMP_FORMAT config variable. Reduce the memory usage with NVLink SHARP (NVLS) * Potentially save hundreds of MBs of device memory, considering the multicast buffer size granularity separately from the address alignment. Update performance tuning for recent Intel CPUs * Improve algorithm/protocol selection on recent CPUs such as Emerald Rapids and Sapphire Rapids. Improve channel scheduling when mixing LL and Simple operations. * Make LL operations account for 4x more traffic to ensure LL and simple operations complete at the same time. Refactor the plugin code * Clean up and harmonize the support code across the network, tuner, and profiler plugins. Add support for comment lines (starting with #) in the nccl.conf file * Issue #1540. Make user buffer registration problems print an INFO instead of a WARN. Drop support for network plugin interface version 5. Fix a race condition with split-shared communicators * NCCL could hang during connection setup if multiple communicators were grouped together that share resources. Fix a performance regression when using NCCL_CROSS_NIC=1 * NCCL would unnecessarily alternate rings, breaking the GPU-NIC associations. Make GID index detection code more resilient * Dynamic GID detection code was giving up too soon if the detected index was not available (e.g., wasn't mapped to the container's sysfs). * Issues #1538, #1573. Fix a race condition with non-blocking operation * Fix issue when creating a non-blocking communicator after a non- blocking collective operation on another communicator. Fix shared memory usage on recent Blackwell GPUs. * Issues NVIDIA/nccl-tests#287, NVIDIA/nccl-tests#291, #1637. Fix an error with NIC fusion and IB SHARP when recreating communicators * Disable the unloading of network plugins Make the auto-merge failures in the NIC fusion non-fatal * This could happen when trying to merge IB and RoCE devices. Fixes to ncclCommAbort * Fix hangs due to the progress thread spinning indefinitely on the network progress. * Reduce the abort time by up to two orders of magnitude. Fix a crash when libnccl.so was dynamically unloaded * The RAS subsystem was missing a clean-up handler. Fix a hang if the network plugin's test() call returns an error. Fix a hang on heterogeneous architectures * Ensure we harmonize the tuning to avoid different tuning choices, causing a hang. Fix double-free on failed ncclCommInitRank and ncclCommFinalize. Fix a potential list traversal bug during a group launch of multiple communicators * Issue #1599. Unify the handling of NCCL configuration variables * Under rare circumstances, some variables specified in the config file could be ignored.
145 lines
4.8 KiB
Makefile
145 lines
4.8 KiB
Makefile
#
|
|
# Copyright (c) 2015-2022, NVIDIA CORPORATION. All rights reserved.
|
|
#
|
|
# See LICENSE.txt for license information
|
|
#
|
|
|
|
CUDA_HOME ?= /usr/local/cuda
|
|
PREFIX ?= /usr/local
|
|
VERBOSE ?= 0
|
|
KEEP ?= 0
|
|
DEBUG ?= 0
|
|
ASAN ?= 0
|
|
UBSAN ?= 0
|
|
TRACE ?= 0
|
|
WERROR ?= 0
|
|
PROFAPI ?= 1
|
|
NVTX ?= 1
|
|
RDMA_CORE ?= 0
|
|
NET_PROFILER ?= 0
|
|
|
|
NVCC = $(CUDA_HOME)/bin/nvcc
|
|
|
|
CUDA_LIB ?= $(CUDA_HOME)/lib64
|
|
CUDA_INC ?= $(CUDA_HOME)/include
|
|
CUDA_VERSION = $(strip $(shell which $(NVCC) >/dev/null && $(NVCC) --version | grep release | sed 's/.*release //' | sed 's/\,.*//'))
|
|
#CUDA_VERSION ?= $(shell ls $(CUDA_LIB)/libcudart.so.* | head -1 | rev | cut -d "." -f -2 | rev)
|
|
CUDA_MAJOR = $(shell echo $(CUDA_VERSION) | cut -d "." -f 1)
|
|
CUDA_MINOR = $(shell echo $(CUDA_VERSION) | cut -d "." -f 2)
|
|
#$(info CUDA_VERSION ${CUDA_MAJOR}.${CUDA_MINOR})
|
|
|
|
# You should define NVCC_GENCODE in your environment to the minimal set
|
|
# of archs to reduce compile time.
|
|
CUDA8_GENCODE = -gencode=arch=compute_50,code=sm_50 \
|
|
-gencode=arch=compute_60,code=sm_60 \
|
|
-gencode=arch=compute_61,code=sm_61
|
|
ifeq ($(shell test "0$(CUDA_MAJOR)" -lt 12; echo $$?),0)
|
|
# SM35 is deprecated from CUDA12.0 onwards
|
|
CUDA8_GENCODE += -gencode=arch=compute_35,code=sm_35
|
|
endif
|
|
CUDA9_GENCODE = -gencode=arch=compute_70,code=sm_70
|
|
CUDA11_GENCODE = -gencode=arch=compute_80,code=sm_80
|
|
CUDA12_GENCODE = -gencode=arch=compute_90,code=sm_90
|
|
CUDA13_GENCODE = -gencode=arch=compute_100,code=sm_100 \
|
|
-gencode=arch=compute_120,code=sm_120
|
|
|
|
CUDA8_PTX = -gencode=arch=compute_61,code=compute_61
|
|
CUDA9_PTX = -gencode=arch=compute_70,code=compute_70
|
|
CUDA11_PTX = -gencode=arch=compute_80,code=compute_80
|
|
CUDA12_PTX = -gencode=arch=compute_90,code=compute_90
|
|
CUDA13_PTX = -gencode=arch=compute_120,code=compute_120
|
|
|
|
|
|
ifeq ($(shell test "0$(CUDA_MAJOR)" -eq 12 -a "0$(CUDA_MINOR)" -ge 8 -o "0$(CUDA_MAJOR)" -gt 12; echo $$?),0)
|
|
# Include Blackwell support if we're using CUDA12.8 or above
|
|
NVCC_GENCODE ?= $(CUDA8_GENCODE) $(CUDA9_GENCODE) $(CUDA11_GENCODE) $(CUDA12_GENCODE) $(CUDA13_GENCODE) $(CUDA13_PTX)
|
|
else ifeq ($(shell test "0$(CUDA_MAJOR)" -eq 11 -a "0$(CUDA_MINOR)" -ge 8 -o "0$(CUDA_MAJOR)" -gt 11; echo $$?),0)
|
|
# Include Hopper support if we're using CUDA11.8 or above
|
|
NVCC_GENCODE ?= $(CUDA8_GENCODE) $(CUDA9_GENCODE) $(CUDA11_GENCODE) $(CUDA12_GENCODE) $(CUDA12_PTX)
|
|
else ifeq ($(shell test "0$(CUDA_MAJOR)" -ge 11; echo $$?),0)
|
|
NVCC_GENCODE ?= $(CUDA8_GENCODE) $(CUDA9_GENCODE) $(CUDA11_GENCODE) $(CUDA11_PTX)
|
|
# Include Volta support if we're using CUDA9 or above
|
|
else ifeq ($(shell test "0$(CUDA_MAJOR)" -ge 9; echo $$?),0)
|
|
NVCC_GENCODE ?= $(CUDA8_GENCODE) $(CUDA9_GENCODE) $(CUDA9_PTX)
|
|
else
|
|
NVCC_GENCODE ?= $(CUDA8_GENCODE) $(CUDA8_PTX)
|
|
endif
|
|
$(info NVCC_GENCODE is ${NVCC_GENCODE})
|
|
|
|
CXXFLAGS := -DCUDA_MAJOR=$(CUDA_MAJOR) -DCUDA_MINOR=$(CUDA_MINOR) -fPIC -fvisibility=hidden \
|
|
-Wall -Wno-unused-function -Wno-sign-compare -std=c++11 -Wvla \
|
|
-I $(CUDA_INC) \
|
|
$(CXXFLAGS)
|
|
# Maxrregcount needs to be set accordingly to NCCL_MAX_NTHREADS (otherwise it will cause kernel launch errors)
|
|
# 512 : 120, 640 : 96, 768 : 80, 1024 : 60
|
|
# We would not have to set this if we used __launch_bounds__, but this only works on kernels, not on functions.
|
|
NVCUFLAGS := -ccbin $(CXX) $(NVCC_GENCODE) -std=c++11 --expt-extended-lambda -Xptxas -maxrregcount=96 -Xfatbin -compress-all
|
|
# Use addprefix so that we can specify more than one path
|
|
NVLDFLAGS := -L${CUDA_LIB} -lcudart -lrt
|
|
|
|
########## GCOV ##########
|
|
GCOV ?= 0 # disable by default.
|
|
GCOV_FLAGS := $(if $(filter 0,${GCOV} ${DEBUG}),,--coverage) # only gcov=1 and debug =1
|
|
CXXFLAGS += ${GCOV_FLAGS}
|
|
NVCUFLAGS += ${GCOV_FLAGS:%=-Xcompiler %}
|
|
LDFLAGS += ${GCOV_FLAGS}
|
|
NVLDFLAGS += ${GCOV_FLAGS:%=-Xcompiler %}
|
|
# $(warning GCOV_FLAGS=${GCOV_FLAGS})
|
|
########## GCOV ##########
|
|
|
|
ifeq ($(DEBUG), 0)
|
|
NVCUFLAGS += -O3
|
|
CXXFLAGS += -O3 -g
|
|
else
|
|
NVCUFLAGS += -O0 -G -g
|
|
CXXFLAGS += -O0 -g -ggdb3
|
|
endif
|
|
|
|
# Make sure to run with ASAN_OPTIONS=protect_shadow_gap=0 otherwise CUDA will fail with OOM
|
|
ifneq ($(ASAN), 0)
|
|
CXXFLAGS += -fsanitize=address
|
|
LDFLAGS += -fsanitize=address -static-libasan
|
|
NVLDFLAGS += -Xcompiler -fsanitize=address,-static-libasan
|
|
endif
|
|
|
|
ifneq ($(UBSAN), 0)
|
|
CXXFLAGS += -fsanitize=undefined
|
|
LDFLAGS += -fsanitize=undefined -static-libubsan
|
|
NVLDFLAGS += -Xcompiler -fsanitize=undefined,-static-libubsan
|
|
endif
|
|
|
|
ifneq ($(VERBOSE), 0)
|
|
NVCUFLAGS += -Xptxas -v -Xcompiler -Wall,-Wextra,-Wno-unused-parameter
|
|
CXXFLAGS += -Wall -Wextra
|
|
else
|
|
.SILENT:
|
|
endif
|
|
|
|
ifneq ($(TRACE), 0)
|
|
CXXFLAGS += -DENABLE_TRACE
|
|
endif
|
|
|
|
ifeq ($(NVTX), 0)
|
|
CXXFLAGS += -DNVTX_DISABLE
|
|
endif
|
|
|
|
ifneq ($(WERROR), 0)
|
|
CXXFLAGS += -Werror
|
|
endif
|
|
|
|
ifneq ($(KEEP), 0)
|
|
NVCUFLAGS += -keep
|
|
endif
|
|
|
|
ifneq ($(PROFAPI), 0)
|
|
CXXFLAGS += -DPROFAPI
|
|
endif
|
|
|
|
ifneq ($(RDMA_CORE), 0)
|
|
CXXFLAGS += -DNCCL_BUILD_RDMA_CORE=1
|
|
endif
|
|
|
|
ifneq ($(NET_PROFILER), 0)
|
|
CXXFLAGS += -DNCCL_ENABLE_NET_PROFILING=1
|
|
endif
|