Skip to content

Commit 216740a

Browse files
committed
updated simple example to use 2 nodes
1 parent c358ffc commit 216740a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/hpc/08_ml_ai_hpc/03_pytorch_on_hpc_mulit_gpu.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Below is a full Slurm script for using DDP for Della (GPU) where there are 2 GPU
140140
```bash
141141
#!/bin/bash
142142

143-
#SBATCH --nodes=1
143+
#SBATCH --nodes=2
144144
#SBATCH --ntasks-per-node=2
145145
#SBATCH --time=1:00:00
146146
#SBATCH --mem=2GB
@@ -160,7 +160,7 @@ srun singularity exec --nv \
160160
/bin/bash -c "source /ext3/env.sh; python simple_ddp.py"
161161
```
162162

163-
In the script above, `MASTER_PORT`, `MASTER_ADDR` and `WORLD_SIZE` are set. The three are later used to create the DDP process group. The total number of GPUs allocated to the job must be equal to `WORLD_SIZE` -- this is satisfied above since nodes times ntasks-per-node is `1 x 2 = 2` and number of GPUs allocated is nodes times gpus_per_node which is also `1 x 2 = 2`.
163+
In the script above, `MASTER_PORT`, `MASTER_ADDR` and `WORLD_SIZE` are set. The three are later used to create the DDP process group. The total number of GPUs allocated to the job must be equal to `WORLD_SIZE` -- this is satisfied above since nodes times ntasks-per-node is `2 x 2 = 4` and number of GPUs allocated is nodes times gpus_per_node which is also `2 x 2 = 4`.
164164

165165
This uses the overlay file for PyTorch we created in [Singularity with Conda](../07_containers/03_singularity_with_conda.md)
166166

0 commit comments

Comments
 (0)