Commit 8fa2478
committed
Honor --include/--exclude in the SLURM launcher
The SLURM runner passed DeepSpeed's own resource-filter strings straight to srun
and sized the job from the unfiltered hostfile, so both filters were broken:
deepspeed --launcher slurm --include worker-1:0,2 train.py
-> srun -n 8 --include worker-1:0,2 ... train.py
srun has no --include, so it exits with "unrecognized option" and the job never
starts. --exclude fares no better: srun does have that flag, but DeepSpeed's
NAME[:SLOT,...] syntax is not a slurm hostlist, and -n still counts every slot in
the pool rather than the ones left after filtering.
runner.py already resolves both flags into active_resources before calling
get_cmd(), so take the process count and the node list from there and pass srun
--nodelist, which is the flag it actually has. --nodelist alone is only an upper
bound, since srun documents that a lower task count "may only require a subset of
the supplied node list", so pass --nodes as well to pin the host count; runner.py
forbids --num_nodes alongside a resource filter, so nothing else sets it.
Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>1 parent 9311fd5 commit 8fa2478
2 files changed
Lines changed: 38 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
362 | 364 | | |
363 | 365 | | |
364 | 366 | | |
| |||
368 | 370 | | |
369 | 371 | | |
370 | 372 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
377 | 386 | | |
378 | 387 | | |
379 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
67 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
68 | 88 | | |
69 | 89 | | |
70 | 90 | | |
| |||
0 commit comments