Repository navigation
batch_job: request the GPUs of a task from sbatch - #4547
Merged
btovar merged 1 commit intoOct 27, 2026
Merged
Conversation
The SLURM branch of cluster_set_resource_string passed the memory, wall time and cores of a task to sbatch, but not its GPUs, so a task or worker that declared GPUs ran on a node without one. Pass them as `--gpus`, the total number of GPUs that sbatch(1) documents for a job, in the same way as the other resources.
btovar
approved these changes
Oct 27, 2026
Member
|
Thanks @ZacKienzle2! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
The SLURM branch of
cluster_set_resource_stringinbatch_job/src/batch_queue_cluster.cpasses the memory, wall time and cores of a task tosbatch, but not its GPUs. A Makeflow rule or avine_factory --gpusworker that declares GPUs is therefore submitted without a GPU request, and on a cluster that confines devices with cgroups the job runs on a node where it sees no GPU.This adds
--gpus=Nwhen the task declares GPUs, in the same way as the other resources.--gpusis the total number of GPUs thatsbatch(1)documents for a job. The HTCondor module already requests GPUs the same way (request_gpusinbatch_queue_condor.c).Checked on a Slurm cluster with a one-rule JX workflow declaring
"gpus": 1, run withmakeflow --jx -T slurm, with no GPU option in-B:sacctshowsReqTRESandAllocTRESwithgres/gpu=1.nvidia-smi -Linside the job lists the allocated GPU.Merge Checklist
make testRun local tests prior to pushing. (0 of 128 tests failed, 9 skipped, built withpackaging/build-conda.)make formatFormat source code to comply with lint policies.make lintRun lint on source code prior to pushing.sbatchoptions as-N 1 -n 1 -c ${CORES} --mem=${MEMORY}M --time=${WALL_TIME_in_minutes}; it could add--gpus=${GPUS}, which this change passes when a rule requests GPUs. Happy to add it if you would like it in this PR.