|
1 | | -# Copyright 2024 "Google LLC" |
| 1 | +# Copyright 2025 "Google LLC" |
2 | 2 | # |
3 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | # you may not use this file except in compliance with the License. |
5 | 5 | # You may obtain a copy of the License at |
6 | 6 | # |
7 | | -# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
8 | 8 | # |
9 | 9 | # Unless required by applicable law or agreed to in writing, software |
10 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 | 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 |
16 | 23 | FROM nvcr.io/nvidia/nemo:$NEMOFW_VERSION |
17 | 24 |
|
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 |
22 | 31 | ENV NCCL_CROSS_NIC=0 |
23 | 32 | ENV NCCL_NET_GDR_LEVEL=PIX |
24 | | -#ENV PMIX_MCA_gds=^ds12 |
25 | 33 | ENV NCCL_P2P_NET_CHUNKSIZE=131072 |
26 | 34 | ENV NCCL_NVLS_CHUNKSIZE=524288 |
27 | | -ENV NCCL_IB_GID_INDEX=3 |
28 | 35 | ENV NCCL_IB_ADAPTIVE_ROUTING=1 |
29 | 36 | ENV NCCL_IB_QPS_PER_CONNECTION=4 |
30 | 37 | ENV NCCL_IB_TC=52 |
31 | 38 | 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 |
35 | 47 |
|
| 48 | +# Set up ldconfig to load nccl-gib |
36 | 49 | RUN echo "/usr/local/gib/lib64" >> /etc/ld.so.conf.d/gib.conf && ldconfig |
37 | 50 | ENV LD_LIBRARY_PATH=/usr/local/gib/lib64:$LD_LIBRARY_PATH |
0 commit comments