Repository navigation
fix(slurm): end the job when a service exits while the driver runs - #4785
Merged
AdamRajfer merged 5 commits intoOct 21, 2026
Merged
Conversation
When a service step such as a vLLM server died mid-run, nothing noticed: the job script kept each service's PID only for the startup health check, so the driver kept retrying the dead service and the job hung until its walltime. The driver now runs in the background, and the job script checks it and every service step every 5 seconds: vLLM services, both vllm_pd tiers and the router, and the Ray head and worker steps. The OTel collector is not checked, because losing it costs telemetry, not the run. If a service exits first, the script names it and its exit status, sends the driver TERM as the time limit would, and exits 1, so the auto-resume chain or a resubmit reruns the job with fresh services. Rollouts that were in flight leave no row and run again on resume. When the driver exits first, the job's exit status is the driver's, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Contributor
Contributor
Author
|
/review |
svcnvidia-nemo-ci
left a comment
Contributor
There was a problem hiding this comment.
HOLD — two RISK findings leave supported service failures undetected.
Inspected all six changed files and traced service launchers, Ray worker expansion, driver exit handling, collector shutdown, and auto-resume. This was a static review; tests and suggested patches were not executed and require author verification.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex
Two gaps the review found in the service watch: - A service step with several tasks, such as a vllm_pd tier or a Ray worker pool, kept its srun alive when one task died, so the watch saw nothing and the driver kept retrying the dead server. Service steps now run with --kill-on-bad-exit=1 --wait=1: any one task's exit ends the whole step within a second, whatever the cluster's KillOnBadExit and WaitTime defaults, and the watch then ends the job. The driver step is unchanged. - The driver's PID was kept in DRIVER_PID, which is also the PID variable of a service named DRIVER, so that service was never watched. The driver's PID now lives in _gym_driver_pid, which no service variable can take. Tests: a service named DRIVER that exits ends the job and names itself; every service step, and not the driver step, carries the two flags. The two vllm_pd golden scripts are updated. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
14d68f8 gave every step rendered by _render_service_command --kill-on-bad-exit=1 --wait=1, the OTel collector included, although the job does not watch the collector. Only watched service steps need the flags, so the collector's srun line is back to what it was, which test_orchestration_otel checks exactly. The service-step test now also asserts that the collector keeps Slurm's defaults, and the two vllm_pd golden scripts drop the flags from their collector line. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Resolve the import conflict in tests/unit_tests/test_slurm_script.py with NVIDIA-NeMo#4730 by keeping both sides imports. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
prokotg
reviewed
Oct 21, 2026
prokotg
reviewed
Oct 21, 2026
…e ends At the end of a successful run the driver can exit and the service steps stop inside one polling window. The watch loop then found a service dead before it saw the driver gone, logged that the service exited while the driver was running, and failed the job. _gym_service_exited now checks the driver first and, if it has exited, returns the driver's status. A test drives that window deterministically: on the loop's first service check both fake steps end, and the check runs only after both have exited. The test also renames the fake-binary loop variable so it no longer shadows the name parameter. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
prokotg
approved these changes
Oct 21, 2026
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39612995962 |
AdamRajfer
added a commit
to AdamRajfer/Gym
that referenced
this pull request
Oct 21, 2026
Resolve the two rendered-script fixtures: the resubmit line now comes before the driver watch that main gained in NVIDIA-NeMo#4785. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
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.
When a service step such as a vLLM server died mid-run, nothing noticed: the job script kept each service's PID only for the startup health check, so the driver kept retrying the dead service and the job hung until its walltime.
Changes:
vllm_pdtiers and the router, and the Ray head and worker steps. The OTel collector is not checked, because losing it costs telemetry, not the run.service <name> exited (status N) while the driver was running; stopping the driver., sends the driverTERMas the time limit would, and exits 1. The auto-resume chain or a resubmit then reruns the job with fresh services; rollouts that were in flight leave no row and run again on resume.Tested with unit tests that run the rendered
job.shwith a fakesrun: a service that dies while the driver runs ends the job with status 1 in about 5 seconds and names the service; a driver that exits first keeps its exit code; Ray workers are watched and the collector is not. The twovllm_pdgolden scripts are updated. The Slurm script, executor, resume and OTel suites pass (295 tests).🤖 Generated with Claude Code