Skip to content

Commit 02f5a0a

Browse files
Merge pull request GoogleCloudPlatform#4725 from SwarnaBharathiMantena/swarnabm/update_nemofw_ex
Update machine-leaning/a3-ultragpu-8g/nemo-framework to fix segmentation fault error
2 parents ec1efd1 + 1535522 commit 02f5a0a

3 files changed

Lines changed: 39 additions & 19 deletions

File tree

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Copyright 2024 "Google LLC"
1+
# Copyright 2025 "Google LLC"
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
55
# You may obtain a copy of the License at
66
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
7+
# http://www.apache.org/licenses/LICENSE-2.0
88
#
99
# Unless required by applicable law or agreed to in writing, software
1010
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -13,25 +13,38 @@
1313
# limitations under the License.
1414

1515
ARG NEMOFW_VERSION=24.12
16+
ARG NCCL_GIB_VERSION=v1.1.0
17+
18+
# Stage 1: Use the nccl-plugin-gib container as an installer
19+
FROM us-docker.pkg.dev/gce-ai-infra/gpudirect-gib/nccl-plugin-gib:${NCCL_GIB_VERSION} AS nccl-gib
20+
RUN /scripts/container_entry.sh install --install-nccl
21+
22+
# Stage 2: Build the final NeMo container
1623
FROM nvcr.io/nvidia/nemo:$NEMOFW_VERSION
1724

18-
ENV NCCL_DEBUG=INFO,WARN
19-
ENV NCCL_DEBUG_SUBSYS=NET,COLL,GPU,INIT,ENV
20-
ENV NCCL_SOCKET_IFNAME=enp0s19,enp192s20
21-
ENV GLOO_SOCKET_IFNAME=enp0s19,enp192s20
25+
# Copy the NCCL gIB plugin and other binaries from the installer stage.
26+
# This replaces the need to manually install and mount /var/lib/gib from the host.
27+
COPY --from=nccl-gib /var/lib/gib /usr/local/gib
28+
29+
# Set the following to match what is in /usr/local/gib/scripts/set_nccl_env.sh
30+
ENV NCCL_NET=gIB
2231
ENV NCCL_CROSS_NIC=0
2332
ENV NCCL_NET_GDR_LEVEL=PIX
24-
#ENV PMIX_MCA_gds=^ds12
2533
ENV NCCL_P2P_NET_CHUNKSIZE=131072
2634
ENV NCCL_NVLS_CHUNKSIZE=524288
27-
ENV NCCL_IB_GID_INDEX=3
2835
ENV NCCL_IB_ADAPTIVE_ROUTING=1
2936
ENV NCCL_IB_QPS_PER_CONNECTION=4
3037
ENV NCCL_IB_TC=52
3138
ENV NCCL_IB_FIFO_TC=84
32-
ENV NCCL_SHIMNET_GUEST_CONFIG_CHECKER_CONFIG_FILE=/usr/local/gib/configs/guest_config.txtpb
33-
ENV NCCL_TUNER_CONFIG_PATH=/usr/local/gib/configs/tuner_config.txtpb
34-
ENV NCCL_NET=gIB
39+
# Use A3 Ultra tuner config
40+
ENV NCCL_TUNER_CONFIG_PATH=/usr/local/gib/configs/tuner_config_a3u.txtpb
41+
42+
43+
# Add NCCL DEBUG at WARN level (useful for debugging)
44+
ENV NCCL_DEBUG=WARN
45+
ENV NCCL_DEBUG_SUBSYS=NET,COLL,GPU,INIT,ENV
46+
ENV GLOO_SOCKET_IFNAME=enp0s19,enp192s20
3547

48+
# Set up ldconfig to load nccl-gib
3649
RUN echo "/usr/local/gib/lib64" >> /etc/ld.so.conf.d/gib.conf && ldconfig
3750
ENV LD_LIBRARY_PATH=/usr/local/gib/lib64:$LD_LIBRARY_PATH

examples/machine-learning/a3-ultragpu-8g/nemo-framework/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ README
4343

4444
```shell
4545
cd launcher_scripts
46-
mkdir data
46+
mkdir -p data
4747

4848
MAX_STEPS=10
4949
NUM_NODES=8
@@ -53,8 +53,8 @@ README
5353
stages=[training] \
5454
training=gpt3/5b \
5555
env_vars.TRANSFORMERS_OFFLINE=0 \
56-
container=../nemo-24.12.sqsh \
57-
container_mounts=[${HOME}/.cache,/usr/local/gib] \
56+
container=../nemo-24.12-v1.1.0.sqsh \
57+
container_mounts=[${HOME}/.cache] \
5858
cluster.srun_args=["--container-writable"] \
5959
training.model.data.data_impl=mock \
6060
training.model.data.data_prefix=[] \

examples/machine-learning/a3-ultragpu-8g/nemo-framework/setup_nemo.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2024 "Google LLC"
2+
# Copyright 2025 "Google LLC"
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -19,12 +19,19 @@
1919
#SBATCH --exclusive
2020

2121
: "${NEMOFW_VERSION:=24.12}"
22+
: "${NCCL_GIB_VERSION:=v1.1.0}"
2223

23-
srun docker build --build-arg="NEMOFW_VERSION=${NEMOFW_VERSION}" -t nemo-"${NEMOFW_VERSION}" .
24-
srun rm -f nemo-"${NEMOFW_VERSION}".sqsh
25-
srun enroot import dockerd://nemo-"${NEMOFW_VERSION}"
24+
# This ensures that the docker process on the compute node can access us-docker.pkg.dev
25+
srun gcloud auth configure-docker us-docker.pkg.dev --quiet
26+
27+
srun docker build \
28+
--build-arg="NEMOFW_VERSION=${NEMOFW_VERSION}" \
29+
--build-arg="NCCL_GIB_VERSION=${NCCL_GIB_VERSION}" \
30+
-t nemo-"${NEMOFW_VERSION}"-"${NCCL_GIB_VERSION}" .
31+
srun rm -f nemo-"${NEMOFW_VERSION}"-"${NCCL_GIB_VERSION}".sqsh
32+
srun enroot import dockerd://nemo-"${NEMOFW_VERSION}"-"${NCCL_GIB_VERSION}"
2633

2734
srun \
2835
--container-mounts="${PWD}":/workspace/mount_dir,/var/tmp:/var/tmp \
29-
--container-image=./nemo-"${NEMOFW_VERSION}".sqsh \
36+
--container-image=./nemo-"${NEMOFW_VERSION}"-"${NCCL_GIB_VERSION}".sqsh \
3037
bash -c "cp -r /opt/NeMo-Framework-Launcher/requirements.txt /opt/NeMo-Framework-Launcher/launcher_scripts /opt/NeMo-Framework-Launcher/auto_configurator /workspace/mount_dir/"

0 commit comments

Comments
 (0)