Skip to content

Commit 259dec3

Browse files
Merge branch 'develop' into enterprise-slurm-fix
2 parents 06f356c + b47dd3a commit 259dec3

71 files changed

Lines changed: 650 additions & 172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pr-precommit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on:
2626
- main
2727
- develop
2828
- release-candidate
29+
- hotfix-*
2930

3031
jobs:
3132
pre-commit:

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ HPC deployments on the Google Cloud Platform.`,
5353
logging.Fatal("cmd.Help function failed: %s", err)
5454
}
5555
},
56-
Version: "v1.74.0",
56+
Version: "v1.75.1",
5757
Annotations: annotation,
5858
}
5959
)
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
The examples in this directory are used to show how enroot + pyxis can be used
2+
to launch containerized workloads via Slurm running on GKE.
3+
4+
Contents:
5+
6+
* `build-nccl-tests.sh`: A Slurm batch script for building the nccl-tests.
7+
* `run-nccl-tests-rdma.sh`: A Slurm batch script for running the nccl-tests for A3 Ultra, A4, A4X with RDMA.
8+
`all_gather_perf` benchmark.
9+
* `run-nccl-tests-tcpxo.sh`: A Slurm batch script for running the nccl-tests for A3 Mega with TCPXO.
10+
`all_gather_perf` benchmark.
11+
12+
# Running NCCL-Tests via Enroot/Pyxis
13+
14+
In general the workflow to deploy GPUDirect-RDMA-enabled workloads via enroot-pyxis is
15+
the following:
16+
17+
1. Convert your container into a squashfs based container image
18+
2. Set required environment variables
19+
3. Run your application workload
20+
21+
## TLDR
22+
23+
For an end-to-end example, copy the `build-nccl-tests.sh` and
24+
`run-nccl-tests-rdma.sh` or `run-nccl-tests-tcpxo.sh` to your login node.
25+
26+
And run the following:
27+
28+
```text
29+
BUILD_JOB=$(sbatch --parsable build-nccl-tests.sh) # takes ~4 minutes
30+
sbatch -d afterok:${BUILD_JOB} run-nccl-tests-rdma.sh # takes ~3 minutes
31+
```
32+
33+
The latter should result in a slurm-XX.out file that contains the result of the nccl
34+
`all_gather_perf` benchmark:
35+
36+
```text
37+
#
38+
# out-of-place in-place
39+
# size count type redop root time algbw busbw #wrong time algbw busbw #wrong
40+
# (B) (elements) (us) (GB/s) (GB/s) (us) (GB/s) (GB/s)
41+
268435456 4194304 float none -1 XXXXX XXX.XX XXX.XX N/A XXXXXX XXX.XX XXX.XX 0
42+
536870912 8388608 float none -1 XXXXX XXX.XX XXX.XX N/A XXXXXX XXX.XX XXX.XX 0
43+
1073741824 16777216 float none -1 XXXXX XXX.XX XXX.XX N/A XXXXXX XXX.XX XXX.XX 0
44+
2147483648 33554432 float none -1 XXXXX XXX.XX XXX.XX N/A XXXXXX XXX.XX XXX.XX 0
45+
4294967296 67108864 float none -1 XXXXX XXX.XX XXX.XX N/A XXXXXX XXX.XX XXX.XX 0
46+
8589934592 134217728 float none -1 XXXXX XXX.XX XXX.XX N/A XXXXXX XXX.XX XXX.XX 0
47+
# Out of bounds values : 0 OK
48+
# Avg bus bandwidth : XXX.XX
49+
#
50+
```
51+
52+
For more details, follow the remainder of this README.
53+
54+
## Detailed Instructions
55+
56+
All of the following should be done on the login node of your slurm cluster,
57+
and while somewhere on the shared Filestore filesystem (typically the user's
58+
home directory).
59+
60+
### Building NCCL-tests
61+
62+
See build-nccl-tests.sh for an example. Within it, you will see that first we'll
63+
create a squashfs version of the container using we want to launch using `enroot
64+
import`. We do this because otherwise we'd be pulling the (typically more than
65+
10GB) image multiple times from the source on each node, converting to sqsh each
66+
time, etc, which would make the job launch longer.
67+
68+
For building the nccl-tests binaries, we use `pyxis` to run the enroot container
69+
and build the nccl-tests within that container to ensure the resulting binaries
70+
are compatible with the container environment.
71+
72+
Both of the above (importing and building) are accomplished by running:
73+
74+
```text
75+
sbatch build-nccl-tests.sh
76+
```
77+
78+
### Running your application on a3-mega instances
79+
80+
For a complete example, run:
81+
82+
```text
83+
sbatch run-nccl-tests-tcpxo.sh
84+
```
85+
86+
### Running your application on a3-ultra instances
87+
88+
For a complete example, run:
89+
90+
```text
91+
sbatch run-nccl-tests-rdma.sh
92+
```
93+
94+
The output will appear in in a `slurm-<job#>.log` file. If the name of your a3-ultragpu
95+
partition is different than "gke", you will need to modify the `build-nccl-tests.sh`
96+
and `run-nccl-tests.sh` scripts's `#SBATCH --partition` setting. Alternatively, you
97+
can run `sbatch -p <your partition> <script>`.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
#SBATCH --exclusive
17+
#SBATCH --ntasks=1
18+
#SBATCH --partition=gke
19+
#SBATCH --ntasks-per-node=1
20+
#SBATCH --gpus-per-node=8
21+
22+
# Usage: sbatch build-nccl-tests.sh
23+
24+
set -x
25+
26+
CONTAINER_IMAGE=./nvidia+pytorch+24.09-py3.sqsh
27+
28+
# Import the pytorch container to enroot if not already present.
29+
if [ ! -f ${CONTAINER_IMAGE} ]; then
30+
# This creates a file named "nvidia+pytorch+24.09-py3.sqsh", which
31+
# uses ~18 GB of disk space. This should be run on a filesystem that
32+
# can be seen by all worker nodes
33+
enroot import docker://nvcr.io#nvidia/pytorch:24.09-py3
34+
fi
35+
36+
# Install nccl-tests using openmpi from within pytorch container
37+
srun --container-mounts="$PWD:/nccl" \
38+
--container-image=${CONTAINER_IMAGE} \
39+
bash -c "
40+
cd /nccl &&
41+
git clone https://github.com/NVIDIA/nccl-tests.git &&
42+
cd /nccl/nccl-tests/ &&
43+
MPI=1 CC=mpicc CXX=mpicxx make -j
44+
"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
#SBATCH --partition=gke
17+
#SBATCH --mem=0
18+
#SBATCH -N 2
19+
#SBATCH --gpus-per-node=8
20+
#SBATCH --ntasks-per-node=8
21+
#SBATCH --exclusive
22+
23+
# Usage: sbatch run-nccl-tests.sh
24+
25+
set -x
26+
# This should be set to the squashfs file that you created for your application
27+
CONTAINER_IMAGE=./nvidia+pytorch+24.09-py3.sqsh
28+
29+
# Set up NCCL Environment variables
30+
# The following two can be useful for debugging
31+
# export NCCL_DEBUG=INFO
32+
# export NCCL_DEBUG_SUBSYS=INIT,NET
33+
34+
# These parameters should not be modified
35+
source /usr/local/gib/scripts/set_nccl_env.sh
36+
export NCCL_NET=gIB
37+
38+
# Mount /var/tmp to allow the rest of the enroot container to be read-only, and
39+
# mount current $PWD to /nccl to for accessing nccl-tests binary
40+
CONTAINER_MOUNTS="/var/tmp:/var/tmp"
41+
42+
# Mount PWD to /nccl in the enroot container
43+
CONTAINER_MOUNTS=${CONTAINER_MOUNTS},"$PWD:/nccl"
44+
45+
# Mount required directories for gIB libnccl-net
46+
CONTAINER_MOUNTS=${CONTAINER_MOUNTS},"/usr/local/gib"
47+
48+
# Run the workload
49+
srun -l \
50+
-N "${SLURM_NNODES}" \
51+
--ntasks-per-node=8 \
52+
--mpi=pmi2 \
53+
--container-image="${CONTAINER_IMAGE}" \
54+
--container-mounts="${CONTAINER_MOUNTS}" \
55+
sh -c "export LD_LIBRARY_PATH=/usr/local/gib/lib64:/usr/lib/x86_64-linux-gnu:\$LD_LIBRARY_PATH;
56+
/nccl/nccl-tests/build/all_gather_perf -b 256M -e 8G -f 2 -g 1 -w 5 --iters 200;
57+
"
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
#SBATCH --partition=gke
17+
#SBATCH --mem=0
18+
#SBATCH -N 2
19+
#SBATCH --gpus-per-node=8
20+
#SBATCH --ntasks-per-node=8
21+
#SBATCH --exclusive
22+
23+
# Usage: sbatch run-nccl-tests.sh
24+
25+
set -x
26+
# This should be set to the squashfs file that you created for your application
27+
CONTAINER_IMAGE=./nvidia+pytorch+24.09-py3.sqsh
28+
29+
# Set up NCCL Environment variables
30+
# The following two can be useful for debugging
31+
# export NCCL_DEBUG=INFO
32+
# export NCCL_DEBUG_SUBSYS=INIT,NET
33+
34+
# These parameters should not be modified
35+
NCCL_LIB_DIR="/usr/local/nvidia/lib64" source /usr/local/nvidia/lib64/nccl-env-profile.sh
36+
export NCCL_FASTRAK_LLCM_DEVICE_DIRECTORY=/dev/aperture_devices
37+
38+
# Here we grab all the environment variables that need to be
39+
# passed down into the container. Slurm would otherwise only pass these env vars
40+
# to the job environment on the host.
41+
# shellcheck disable=SC2001
42+
HOST_VARS=$(sed 's/ \{1,\}/,/g' <<<"${!NCCL*}")
43+
44+
# Mount /var/tmp to allow the rest of the enroot container to be read-only, and
45+
# mount current $PWD to /nccl to for accessing nccl-tests binary
46+
CONTAINER_MOUNTS="/var/tmp:/var/tmp"
47+
48+
# Mount PWD to /nccl in the enroot container
49+
CONTAINER_MOUNTS=${CONTAINER_MOUNTS},"$PWD:/nccl"
50+
51+
# Mount required directories for GPUDirect-TCPXO functionality
52+
CONTAINER_MOUNTS=${CONTAINER_MOUNTS},"/usr/local/nvidia/lib64/"
53+
54+
# Run the workload
55+
srun -l \
56+
-N "${SLURM_NNODES}" \
57+
--mpi=pmi2 \
58+
--ntasks-per-node=8 \
59+
--container-image="${CONTAINER_IMAGE}" \
60+
--container-env="${HOST_VARS}" \
61+
--container-mounts="${CONTAINER_MOUNTS}" \
62+
sh -c "
63+
export LD_LIBRARY_PATH=/usr/local/nvidia/lib64:/usr/lib/x86_64-linux-gnu:\$LD_LIBRARY_PATH;
64+
/nccl/nccl-tests/build/all_gather_perf -b 8M -e 8G -f 2 -g 1 -w 5 --iters 200;
65+
"

community/examples/xpk-n2-filestore/xpk-n2-filestore.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ deployment_groups:
6464
- display_name: deployment-machine
6565
cidr_block: $(vars.authorized_cidr)
6666
version_prefix: "1.31."
67-
release_channel: RAPID
67+
release_channel: REGULAR
6868
maintenance_exclusions:
6969
- name: no-minor-or-node-upgrades-indefinite
70-
start_time: "2024-12-01T00:00:00Z"
71-
end_time: "2025-12-22T00:00:00Z"
70+
start_time: "2025-12-01T00:00:00Z"
7271
exclusion_scope: NO_MINOR_OR_NODE_UPGRADES
72+
exclusion_end_time_behavior: UNTIL_END_OF_SUPPORT
7373
enable_filestore_csi: true
7474
outputs: [instructions]
7575

community/modules/compute/gke-nodeset/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ terraform {
2222
}
2323
}
2424
provider_meta "google" {
25-
module_name = "blueprints/terraform/hpc-toolkit:gke-nodeset/v1.74.0"
25+
module_name = "blueprints/terraform/hpc-toolkit:gke-nodeset/v1.75.1"
2626
}
2727
}

community/modules/compute/gke-partition/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ terraform {
2222
}
2323
}
2424
provider_meta "google" {
25-
module_name = "blueprints/terraform/hpc-toolkit:gke-partition/v1.74.0"
25+
module_name = "blueprints/terraform/hpc-toolkit:gke-partition/v1.75.1"
2626
}
2727
}

community/modules/compute/htcondor-execute-point/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ terraform {
2929
}
3030

3131
provider_meta "google" {
32-
module_name = "blueprints/terraform/hpc-toolkit:htcondor-execute-point/v1.74.0"
32+
module_name = "blueprints/terraform/hpc-toolkit:htcondor-execute-point/v1.75.1"
3333
}
3434
}

0 commit comments

Comments
 (0)