Repository navigation
fix(orchestration): settle a requeued chain on its REQUEUED records - #5992
Conversation
The sentinel that reconciles a requeued chain waited for every incarnation to have a terminal scheduler record, but sacct keeps the earlier incarnation of a requeued job as a REQUEUED row, and the check did not accept that state. A chain with a real requeue therefore never settled: the sentinel timed out and left the chain stopped. Accept REQUEUED for an incarnation that a later one followed, as the recovery reader already does; the last incarnation still REQUEUED waits to run again and does not settle. Signed-off-by: Adam Rajfer <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found.
I reviewed both changed files and traced the affected accounting and recovery path. The settlement check now matches the Python reader: an older REQUEUED incarnation can settle only when the same job has a later incarnation. A latest REQUEUED row, incomplete restart history, and nonterminal records still prevent recovery.
The new regression tests exercise the rendered prologue and real recovery reader, checking one preserved-budget submission, 15050 seconds of accumulated walltime, and no submission while the latest incarnation remains requeued.
This was a static review; I didn't execute tests.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test a0bfee9 |
yuhezhang-ai
left a comment
There was a problem hiding this comment.
Looks good to me. The shell settlement check now matches the recovery reader, and the new tests cover both historical and latest REQUEUED records.
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/43510597368 |
What does this PR do?
A requeued resumable chain never settles, so the sentinel stops it.
When Slurm requeues a job, sacct keeps the earlier incarnation as a
REQUEUEDrow for good._gym_chain_settledin the resume script accepted only COMPLETED, FAILED, CANCELLED, TIMEOUT, OUT_OF_MEMORY, NODE_FAIL, BOOT_FAIL, DEADLINE and PREEMPTED, so with a real requeue the check never passed. The sentinel then timed out with "its terminal scheduler records did not settle within 300s" and left the chain stopped, although no budget was spent. The operator had to recover by hand.The Python reader in
recovery.py(accounted_requeued_chain_walltime,allocation_cut_from_accounting) already treatsREQUEUEDas ended once a later incarnation exists. This change makes the shell check agree.REQUEUEDcounts as settled only for an incarnation that a later one followed. A last incarnation stillREQUEUEDis waiting to run again and still does not settle.Seen on an eval chain where the follow-up job was requeued once. Its sacct rows were
REQUEUED|36|0andFAILED|14|1, next to the previous job'sFAILEDrow.Related: #4840 (a requeue no longer queues a duplicate follow-up) and #4978 (count a requeued job's walltime and retry once). This PR touches neither counter. It only changes which sacct states the sentinel accepts as settled.
Validation
tests/unit_tests/orchestration/test_requeued_chain_sentinel.py::test_a_requeued_follow_up_settles_on_its_requeued_recorduses the row shape above. It fails before the fix and passes after it: one recovery is queued, with the right accumulated walltime.test_a_last_incarnation_still_requeued_does_not_settleguards the case that must keep waiting.uv run --extra dev python -m pytest tests/unit_tests/orchestration/test_requeued_chain_sentinel.py tests/unit_tests/test_resume_script.py: 222 passed.ruff checkandruff format --checkare clean on the changed files.