【发布时间】:2021-02-09 22:23:25
【问题描述】:
我有一个大型计算节点集群,每个节点有 6 个 GPU。我想开始,比如说,100 名工作人员在这件事上,每个人都只能访问一个 GPU。
我现在的做法是这样的:
sbatch --gres=gpu:6 --gpus-per-task=1 --ntasks='100' main.sh
在main.sh里面:
srun --gpus-per-task=1 --gres=gpu:1 -n 100 worker.sh
这样,我启动了 100 个工作人员(完全使用了 17 个节点)。但我有一个问题:CUDA_VISIBLE_DEVICES 设置不正确。
sbatch --gres=gpu:6 --gpus-per-task=1 --ntasks='100' main.sh
# CUDA_VISIBLE_DEVICES in main.sh: 0,1,2,3,4,5 (that's fine)
srun --gpus-per-task=1 --gres=gpu:1 -n 100 worker.sh
# CUDA_VISIBLE_DEVICES in worker.sh: 0,1,2,3,4,5 (this is my problem: how to assign exactly 1 GPU to each worker and to that worker alone?)
我对 Slurm 的实际工作方式可能存在误解,因为我是在此类 HPC 系统上进行编程的新手。但是任何线索如何实现我想要实现的目标? (每个工人都有 1 个 GPU 分配给它,而且只有它)
我们使用 SLURM 20.02.2。
【问题讨论】: