Skip to content

fix(sc): keep the watchdog armed while the train pump drains - #3783

Open
tianyi-zhang-02 wants to merge 5 commits into
NVIDIA-NeMo:mainfrom
tianyi-zhang-02:fix/sc-run-supervision
Open

fix(sc): keep the watchdog armed while the train pump drains#3783
tianyi-zhang-02 wants to merge 5 commits into
NVIDIA-NeMo:mainfrom
tianyi-zhang-02:fix/sc-run-supervision

Conversation

@tianyi-zhang-02

@tianyi-zhang-02 tianyi-zhang-02 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Keeps the SingleController train pump, rollout pump, stall watchdog, and generation-fleet probe supervised until the train pump exits.

Previously run() waited only once with FIRST_COMPLETED. A normally exhausted rollout pump then left the train pump draining while watchdog and fleet-probe failures were no longer observed; cleanup retrieved and discarded those exceptions. The new loop preserves the existing priority order—fleet probe, watchdog, rollout, then train—while continuing to watch every pending task.

The tests cover watchdog failure both before and after rollout exhaustion, clean completion, rollout failure during a wedged train pump, and fleet-probe failure during the drain.

Validation

Final SHA: 7d740e95526d94e650c651168f521360310ea526, merged with current main (ccbcd4cc5).

Environment: Runpod Secure Cloud, nvcr.io/nvidia/nemo-rl:v0.7.0, Python 3.13.14, PyTorch 2.11.0+cu130; tests ran CPU-only with CUDA_VISIBLE_DEVICES=''.

  • All 5 focused supervision tests passed.
  • The test actor fake was updated for the current-main weight-synchronizer and rollout-recovery preamble.
  • Ruff check and format-check passed on both changed Python files.

@tianyi-zhang-02
tianyi-zhang-02 requested review from a team as code owners August 24, 2026 03:58
@copy-pr-bot

copy-pr-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-maintainers Waiting on maintainers to respond label Aug 26, 2026
run() waits once with FIRST_COMPLETED, handles whichever task finished, then
falls through to a bare `await train_task`. From that point the watchdog and
the fleet probe are still running but nothing awaits them again, and the
`finally` retrieves their exceptions with gather(return_exceptions=True) and
discards them -- so not even asyncio's "Task exception was never retrieved"
warning fires.

The window this opens is the normal path, not an edge case. The rollout pump
finishing first is end-of-data, as run()'s own comment says: "A normally
exhausted rollout pump leaves the train pump to drain committed groups." For
the whole of that drain, a RolloutStall under stall_action: abort, a
GenerationFleetExhausted, or an env-health abort lands on an unobserved task
while run() parks on the wedged train pump. The job then holds its GPUs until
the scheduler's wall clock kills it, with nothing in the driver log -- which is
what WatchdogConfig, documented as "Last-resort detection for stalls that no
other layer catches", exists to prevent.

Loop the wait instead, so every task stays supervised until the train pump
exits. The priority order (probe, watchdog, rollout, train) is unchanged, and
so is the behaviour when the train pump finishes first.

Three tests. The drain-phase one fails on main with a TimeoutError rather than
the RolloutStall it asserts; the other two pin the paths that already worked.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Tianyi Zhang <123608656+tianyi-zhang-02@users.noreply.github.com>
tianyi-zhang-02 added a commit to tianyi-zhang-02/RL that referenced this pull request Aug 27, 2026
…ge reads

Nine controller stubs in this file predate that attribute, so they pass here
and fail once merged with current main -- NVIDIA-NeMo#3768 made _advantage_stage read it
unconditionally. Same shape as the _rollout_manager stub gap in NVIDIA-NeMo#3783.

Signed-off-by: Tianyi Zhang <zhangtianyi975@gmail.com>
Signed-off-by: Tianyi Zhang <123608656+tianyi-zhang-02@users.noreply.github.com>
The three tests here all take the watchdog branch. Two others were unreached:

  - rollout-pump failure. Every test has the rollout pump either exhaust
    cleanly or never finish, so the branch whose comment promises immediate
    propagation was never exercised. It is the branch that matters most under
    the old single wait: a failed rollout task sits in pending, unawaited,
    while run() parks on the train pump.
  - the fleet probe. _bare_actor sets _gen_fleet = None, so run() creates no
    probe task at all and the "probe_task in done" branch was dead in every
    test.

Both use a distinct exception type so a test cannot pass by catching the
wrong task's failure.

Mutation-tested: collapsing the loop, and skipping either await, each turn
one of these red.

Signed-off-by: Tianyi Zhang <123608656+tianyi-zhang-02@users.noreply.github.com>
…pumps

The branch predated that call, so the test passed here and failed once merged
with current main -- mergeable, but red afterwards. Only showed up when I
merged all twenty of my open PRs together and bisected back.

Signed-off-by: Tianyi Zhang <zhangtianyi975@gmail.com>
Signed-off-by: Tianyi Zhang <123608656+tianyi-zhang-02@users.noreply.github.com>
Signed-off-by: Tianyi Zhang <123608656+tianyi-zhang-02@users.noreply.github.com>
Signed-off-by: Tianyi Zhang <123608656+tianyi-zhang-02@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-request waiting-on-maintainers Waiting on maintainers to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants