|
| 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>`. |
0 commit comments