SlurmExecutor: `no_requeue` has no effect because `--requeue` is hard-coded

Open Beginner friendly
#727 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start with nemo_run/run/torchx_backend/schedulers/slurm.py at the sbatch command locations cited in the issue, then check nemo_run/run/ray/slurm.py and the dry-run output. Verify how requeue, no_requeue, and SBATCH_NO_REQUEUE are handled across those paths. Done when the default remains requeueable, either opt-out disables it, and the dry run shows consistent submission and script options.

Written by the indexing model from the issue text.

Description

community-request

Describe the bug

The Slurm scheduler always runs sbatch --requeue --parsable ... (slurm.py#L180, also #L148, #L253, ray/slurm.py#L591). As a result, neither additional_parameters={"no_requeue": True} nor SBATCH_NO_REQUEUE=1 can turn requeue off.

Steps/Code to reproduce bug

import nemo_run as run

executor = run.SlurmExecutor(
    account="my_account",
    tunnel=run.LocalTunnel(job_dir="/tmp/nemo_run_repro"),
    additional_parameters={"no_requeue": True},
)
run.run(run.Script(inline="echo hello"), executor=executor, dryrun=True)

The dry run shows the job script asks for no requeue, but it is submitted with --requeue:

sbatch --requeue --parsable $SBATCH_SCRIPT
...
#SBATCH --no-requeue

Submitted like this, the job is requeueable (Slurm 24.11: scontrol show job <id> shows Requeue=1), because sbatch's command line overrides #SBATCH lines and SBATCH_* environment variables.

Expected behavior

Requeue stays the default, but no_requeue or SBATCH_NO_REQUEUE=1 turns it off.

Additional context

Possible fix: write requeue as #SBATCH --requeue like the other options (unless the user sets requeue or no_requeue), and drop --requeue from the sbatch commands.

Dominant language
Python
Stars
268
Forks
121
Avg merge
3h 42m
Merged PRs (30d)
4

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA-NeMo/Run

All issues in NVIDIA-NeMo/Run

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.