Skip to content

Commit 6ef3a01

Browse files
authored
Benchmarks: Add MSCCL Support for Nvidia GPU (#584)
**Description** Add MSCCL support for Nvidia GPU
1 parent dd5a632 commit 6ef3a01

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

.github/workflows/build-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- name: Checkout
5555
uses: actions/checkout@v2
5656
with:
57-
submodules: true
57+
submodules: recursive
5858
- name: Free disk space
5959
run: |
6060
mkdir /tmp/emptydir

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
[submodule "third_party/gpu-burn"]
2222
path = third_party/gpu-burn
2323
url = https://github.com/wilicc/gpu-burn.git
24+
[submodule "third_party/msccl"]
25+
path = third_party/msccl
26+
url = https://github.com/Azure/msccl

dockerfile/cuda12.2.dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ RUN apt-get update && \
3535
libavutil-dev \
3636
libboost-program-options-dev \
3737
libcap2 \
38+
libcurl4-openssl-dev \
3839
libnuma-dev \
3940
libpci-dev \
4041
libswresample-dev \
@@ -43,6 +44,7 @@ RUN apt-get update && \
4344
lshw \
4445
python3-mpi4py \
4546
net-tools \
47+
nlohmann-json3-dev \
4648
openssh-client \
4749
openssh-server \
4850
pciutils \
@@ -129,7 +131,7 @@ ADD dockerfile/etc /opt/microsoft/
129131
WORKDIR ${SB_HOME}
130132

131133
ADD third_party third_party
132-
RUN make -C third_party cuda
134+
RUN make -C third_party cuda_with_msccl
133135

134136
ADD . .
135137
RUN python3 -m pip install --upgrade setuptools==65.7 && \

third_party/Makefile

+25-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ HPCX_HOME ?= /opt/hpcx
1111
CUDA_VER ?= $(shell nvcc --version | grep 'release' | awk '{print $$6}' | cut -c2- | cut -d '.' -f1-2)
1212
ROCBLAS_BRANCH ?= rocm-$(shell dpkg -l | grep 'rocm-dev ' | awk '{print $$3}' | cut -d '.' -f1-3)
1313

14-
.PHONY: all cuda rocm common cuda_cutlass cuda_bandwidthTest cuda_nccl_tests cuda_perftest rocm_perftest fio rocm_rccl_tests rocm_rocblas rocm_bandwidthTest gpcnet cuda_gpuburn cpu_stream cpu_hpl directx_amf_encoding_latency directx_amd rocm_hipblaslt megatron_lm megatron_deepspeed
14+
.PHONY: all cuda_with_msccl cuda rocm common cuda_cutlass cuda_bandwidthTest cuda_nccl_tests cuda_perftest cuda_msccl rocm_perftest fio rocm_rccl_tests rocm_rocblas rocm_bandwidthTest gpcnet cuda_gpuburn cpu_stream cpu_hpl directx_amf_encoding_latency directx_amd rocm_hipblaslt megatron_lm megatron_deepspeed
1515

1616
# Build all targets.
1717
all: cuda rocm
18+
cuda_with_msccl: cuda cuda_msccl
1819
cuda: common cuda_cutlass cuda_bandwidthTest cuda_nccl_tests cuda_perftest gpcnet cuda_gpuburn megatron_lm megatron_deepspeed
1920
rocm: common rocm_perftest rocm_rccl_tests rocm_rocblas rocm_bandwidthTest rocm_hipblaslt megatron_deepspeed
2021
cpu: common cpu_perftest
@@ -188,3 +189,26 @@ megatron_deepspeed:
188189
cd Megatron && \
189190
python -m pip install -r requirements.txt && \
190191
python -m pip install DeepSpeed
192+
193+
# Build MSCCL for CUDA
194+
cuda_msccl: sb_micro_path
195+
ifneq (,$(wildcard msccl/executor/msccl-executor-nccl/Makefile))
196+
cd ./msccl/executor/msccl-executor-nccl && \
197+
make -j4 src.build && \
198+
cd ../../..
199+
mkdir -p $(SB_MICRO_PATH)/lib/msccl-executor-nccl && \
200+
cp -r -v ./msccl/executor/msccl-executor-nccl/build/* $(SB_MICRO_PATH)/lib/msccl-executor-nccl/
201+
endif
202+
ifneq (,$(wildcard msccl/scheduler/msccl-scheduler/Makefile))
203+
cd ./msccl/scheduler/msccl-scheduler && \
204+
CXX=nvcc BIN_HOME=$(SB_MICRO_PATH)/lib/msccl-executor-nccl SRC_HOME=../../../msccl/executor/msccl-executor-nccl make -j4 && \
205+
cd ../../..
206+
mkdir -p $(SB_MICRO_PATH)/lib/msccl-scheduler && \
207+
cp -r -v ./msccl/scheduler/msccl-scheduler/build/* $(SB_MICRO_PATH)/lib/msccl-scheduler/
208+
endif
209+
ifneq (,$(wildcard msccl/tests/msccl-tests-nccl/Makefile))
210+
cd ./msccl/tests/msccl-tests-nccl && \
211+
make MPI=1 MPI_HOME=$(MPI_HOME) NCCL_HOME=$(SB_MICRO_PATH)/lib/msccl-executor-nccl -j4 && cd ../../..
212+
mkdir -p $(SB_MICRO_PATH)/bin/msccl-tests-nccl && \
213+
cp -r -v ./msccl/tests/msccl-tests-nccl/build/* $(SB_MICRO_PATH)/bin/msccl-tests-nccl/
214+
endif

third_party/msccl

Submodule msccl added at 7d4beb8

0 commit comments

Comments
 (0)