fix: anchor checkpoint TimeoutChecker at SLURM allocation start - #3639
Closed
bobby-nandigam wants to merge 1 commit into
Closed
fix: anchor checkpoint TimeoutChecker at SLURM allocation start#3639bobby-nandigam wants to merge 1 commit into
bobby-nandigam wants to merge 1 commit into
Conversation
checkpoint_must_save_by exists to guarantee a checkpoint is written before the allocation is reclaimed. TimeoutChecker, however, anchored its budget at construction time, which every algorithm reaches only after setup (Ray init, cluster spinup, model/vLLM load). The budget therefore silently excluded the 20-30 minutes of setup, so the timeout save could fire after the allocation was already killed -- losing exactly the work the knob is meant to protect. Anchor the budget at SLURM_JOB_START_TIME (exported by Slurm >= 23.02) when it is available, through the single TimeoutChecker constructor, so every algorithm is corrected with no call-site changes. When the variable is unset or malformed (Kubernetes, local runs, older Slurm) the checker falls back to the previous construction-time behavior, and a malformed value warns instead of crashing. A construction-time log records the anchor source and the effective remaining budget so the change is visible in every run. Closes #3596 Signed-off-by: Bobby Nandigam <bobbynandigam.official@gmail.com>
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.
What does this PR do ?
checkpoint_must_save_byis meant to guarantee that a checkpoint is writtenbefore the allocation is reclaimed. But
TimeoutCheckeranchors its budgetat construction time:
Every algorithm constructs the checker after
setup()returns — Ray init,cluster spinup, and model/vLLM loading have already happened. The budget
therefore silently excludes 20–30 minutes of setup: a user who requests a 4h
allocation and sets
checkpoint_must_save_by: "00:03:30:00"actually gets asave at
training_start + 3h30=allocation + 3h30 + setup. With enoughsetup, the timeout save fires after the allocation is already dead — losing
exactly the work the knob exists to protect.
The fix
Anchor the budget at the allocation start when SLURM provides it, through the
single
TimeoutCheckerconstructor — so all algorithms are corrected with nocall-site changes:
SLURM_JOB_START_TIME(exported by Slurm ≥ 23.02) via a smallget_slurm_job_start_time()helper.to today's construction-time behavior, a clean no-op. A malformed value warns
rather than crashing.
start_timeargument still wins, for tests and callers that wantto pin it.
budget, so the semantic is visible in every run, e.g.
TimeoutChecker anchored at SLURM_JOB_START_TIME; effective remaining budget 3:17:00.The new default's failure mode (save slightly earlier than a training-start
anchored user expected) is benign; the old default's failure mode (save after
the allocation dies) loses work.
Issues
Closes #3596.
Usage
No config change and no new knob.
checkpoint_must_save_bynow budgets from theSLURM allocation start automatically; non-SLURM environments are unaffected.
Before your PR is "Ready for review"
tests/unit/utils/test_timer.py)Additional Information
SLURM_JOB_START_TIMEwas added in Slurm 23.02 and is epoch seconds; olderSlurm simply doesn't set it and hits the
Nonefallback.TimeoutCheckerplacement is correctlegacy parity and needs no change — this is a pre-existing, cross-cutting
semantic).