Skip to content

Commit c68231a

Browse files
committed
Add ntasks for older slurm versions.
Without this flag, on slurm 23.11.10 we get this error: ``` sbatch: error: Failed to validate job spec. --gpus-per-task or --tres-per-task used without either --gpus or -n/--ntasks is not allowed. sbatch: error: Invalid generic resource (gres) specification ```
1 parent 50da5af commit c68231a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

torchx/schedulers/slurm_scheduler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def from_role(
210210
sbatch_opts.setdefault("gpus-per-node", str(resource.gpu))
211211
else:
212212
sbatch_opts.setdefault("gpus-per-task", str(resource.gpu))
213+
sbatch_opts.setdefault("ntasks", "1")
213214

214215
srun_opts = {
215216
"output": f"slurm-{macros.app_id}-{name}.out",

0 commit comments

Comments
 (0)