TECHNOLOGY

Slurm requeue: the same job can execute its batch script again

In this article
THE QUICK TAKE

Requeue does not resume a live process: the batch script starts again, so stable work identity and execution-attempt evidence must be separate.

A batch job is requeued after interruption. Its identifier still names the same job, but the script’s setup and output steps run again. Reading all records under that identifier as one uninterrupted process can hide repeated initialization, overwritten evidence and a checkpoint chosen from the wrong execution attempt.

Separate job and execution attempt

Preserve job identity, input revision, restart count and an application-generated attempt record. The sbatch reference documents SLURM_RESTART_COUNT and says the batch script starts from its beginning after requeue. A stable scheduler identifier therefore does not mean the old address space continued. Record fresh process identities and initialization events so operators can reconstruct which execution loaded a model, produced an artifact or observed an error.

Read the actual requeue path

The scontrol reference describes requeue into pending state and a distinct requeuehold operation that also holds the job. Pending is not a promise of immediate new allocation or readiness. Preserve the trigger, policy and resulting state before interpreting a gap as failed restoration. The Mirage guide concerns a different successor-allocation design; its historical replay does not supply a requeue recovery-time guarantee for the current cluster.

Make initialization restart-aware

Review downloads, scratch preparation, lock acquisition and output-directory creation at the top of the script. They must distinguish reusable validated inputs from incomplete leftovers. A marker file created before initialization finished is not a successful preparation receipt. The stable input identity guide describes an adjacent retry boundary: logical work remains the same while attempts differ. Apply that distinction to the script’s actual external operations instead of using restart count as a new dataset identity.

Select a coherent checkpoint

Define how the new execution chooses a committed snapshot and checks input and format compatibility. Keep progress identities with the saved application state. Requeue alone does not save model, optimizer, random state or output publication. A checkpoint filename containing the job identifier can still refer to a partial write from the previous attempt. Prefer a validated immutable checkpoint and a clearly defined selection record, with storage accessibility appropriate to the newly allocated node.

Exercise interruption across boundaries

In a disposable job, interrupt before preparation completes, after a checkpoint is committed and after output publication but before normal script exit. Record restart count, process identity, selected snapshot and accepted output identities. Confirm the new attempt neither trusts incomplete state nor silently duplicates accepted work. This proposed acceptance protocol states no measured restart duration or completed production test. It distinguishes scheduler requeue from the application continuation that must be demonstrated separately.

Keep evidence from earlier attempts

Use attempt-qualified diagnostics so a later script invocation does not erase the cause of the previous interruption. Preserve the final job state alongside per-attempt outcomes. A successful later execution can resolve the logical workload without making the earlier failure disappear from accounting or incident records. The useful guarantee is a restart-aware application protocol under the documented requeue path, not transparent process migration, exactly-once external effects or recovery from every cluster and storage failure.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles