Repository navigation
Conversation
Contributor
…y once A Slurm requeue keeps the job id and runs job.sh again with the same previous job, so the auto-resume prologue added that job's walltime (and an infra retry) a second time. The walltime cap could then stop a chain hours early. Signed-off-by: Wojciech Prazuch <[email protected]>
wprazuch
force-pushed
the
wprazuch/resume-requeue-idempotent
branch
from
October 23, 2026 14:18
ecb2dea to
9c749fc
Compare
This branch was previously deployed
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?
When Slurm requeues a job (node failure, preemption), it keeps the job id and runs
job.shagain with the same previous-job argument. The auto-resume prologue then adds the previous job's walltime to.gym_accumulated_walltimea second time, and spends a second infra retry for the same failure. Withmax_walltimeset, a chain can stop hours before its real budget is used.The prologue now counts each previous job once. It takes an atomic
mkdirmarker (.gym_prev_job_counted.<prev_job_id>) in the output dir. Only the run that creates the marker adds the walltime and the retry.No linked issue: found while debugging a chain that stopped early on a requeued job. This complements #4840 (merged), which stops a requeue from queueing a duplicate follow-up job. The two touch the same prologue but fix different counters.
Validation
uv run --extra dev python -m pytest tests/unit_tests/test_resume_script.py tests/unit_tests/test_eval_resubmit.py tests/unit_tests/test_slurm_script.py tests/unit_tests/test_slurm_executor.py: 365 passed, on top of fix(orchestration): uv on PATH, one resume follow-up per job, resubmit round trip, failed chain stops #4840.test_max_retries_allows_exactly_that_many_retriesnow uses a distinct previous job id per retry, as real chains do.pre-commit run --all-files: passed.Rollouts
N/A. This changes Slurm orchestration only. No environment or agent code changes.
Compatibility and benchmark impact
None. Chains that are never requeued behave exactly as before.
Checklist
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).