Repository navigation
feat(dynamo): run generation fleet health behind the Dynamo frontends - #5349
jthomson04 wants to merge 5 commits into
Conversation
With policy.generation.dynamo=true, async_rl.generation_fleet_health was refused at startup: the frontends pick engines themselves, so they kept routing to a quarantined shard, and a restarted shard never registered. The SingleController now tells the generation backend which shards are in service (GenerationInterface.set_serving_shards, a no-op by default), on every fleet probe and before generation resumes after a refit. Behind Dynamo, VllmGeneration makes the frontends' routing match: - a shard leaving service unregisters its discovery record, so every frontend stops routing to it while its requests in flight finish; - a quarantined shard that does not confirm is killed, so its registration goes with its etcd lease; - a restarted shard starts its Dynamo endpoint only once a refit has returned it to service. A call through a frontend does not say which engine failed it, so behind Dynamo the liveness probe also fails when the engine's endpoint stopped serving or vLLM reports its engine core dead. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: jthomson04 <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test 222b24a |
jthomson04
left a comment
There was a problem hiding this comment.
Reviewed at 222b24a5ac by five reviewers and two adversarial passes. Every finding below was reproduced or run. All the suggested changes were applied together on a scratch copy: pinned ruff is clean and the PR's unit tests pass (101, 14, 6 and 26 passed in the four selections that touch the changed files).
The design is right: one hook on the backend, the whole serving set on every push, and the fleet monitor stays the only place that decides whether a shard may serve. What the PR assumes about Dynamo holds on the pinned Dynamo nightly, checked against two real frontends: unregister_endpoint_instance() removes only the instance record, both frontends stop routing within milliseconds, calls in flight finish, and register_endpoint_instance() puts the same instance back. Native vLLM behaves as on main.
- (C1) A shard restarted during a refit can end up never registered with the frontends, with no error. Asks for a fix and one run.
- (C2) An unreachable actor is taken for a dead process, so a quarantined engine that is alive is not killed.
- (C3)
test_watchdog_pump.pynow raises inside the pump on every tick and still passes. - (C4) No CI job runs the two new lane lines, and the lane does not say so.
- (C5) The guide's "fail and are retried" is true only for calls without a session, and its quarantine row leaves out the wait.
- (C6) The routing calls and the routed flag belong on
DynamoEngineAdapter. Low severity. - (C7) The functional check passes for a replacement that never took a request.
- (C8) The comment on why the push is skipped while a refit recovers is true for one of the three ways a refit can fail.
- (C9) The design doc's Dynamo-upgrade list does not name the new
Endpointcalls. - (C10) Nothing tests why a restarting shard is not quarantined.
For context, no action:
- What the functional proof covers. NeMo RL's own rollouts, with the kill at a step boundary. Not run anywhere: NeMo-Gym with fleet health behind Dynamo, a shard lost during a refit behind Dynamo (C1 asks for this one), and, against a real frontend, a live engine's unregister call and the kill of a quarantined shard. Both lane lines SIGKILL the shard, so they only reach
its process is gone. - Upstream. A session bound to an engine that is dead but still listed gets HTTP 500 until the lease expires, because the binding is a hard constraint by default. Dynamo has
--router-session-affinity-mode softat the pin; it was not measured. - Lost link to etcd. An engine that cannot reach etcd for longer than its lease loses its Dynamo endpoint for the rest of that process. The new probe then fails the shard, which is the right outcome, but the guide does not name this cause.
- CI on this head.
Lint checkpasses. No unit or functional lane has run.
Generated by Claude Code
…leet-health-main Signed-off-by: jthomson04 <[email protected]>
Review of the fleet-health change (C1-C10): - set_serving_shards records the leader each routed shard registered from. A restart swaps the leader, so a replaced shard is out of the routing before any call is built, and its replacement is asked to start its endpoint when it returns to service. Calls are no longer kept across pushes: a shard that did not confirm is asked again by the next push. - Only ActorDiedError means an engine's process is gone. A quarantined shard that is unreachable or silent is killed. - DynamoEngineAdapter.set_routed holds the register and unregister calls and the routed flag. The worker keeps its adapter only once the endpoint started, so a start that raised is tried again. - _push_serving_shards catches its own failure, for both callers. - Tests: the watchdog fixture carries what the pump reads; the functional check requires the replacement to have taken a request; the Dynamo lane says when its shard-loss tests skipped and runs one fast line with fleet health on. - Docs: who retries calls to a dead engine, what probe_timeout_s also bounds, and the Endpoint calls a Dynamo upgrade has to re-check. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: jthomson04 <[email protected]>
|
/ok to test 99b6527 |
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
…leet-health-main Signed-off-by: jthomson04 <[email protected]>
|
/ok to test 77b1c50 |
…leet-health-main Signed-off-by: jthomson04 <[email protected]> # Conflicts: # tests/unit/models/generation/test_dynamo_vllm_adapter.py
|
/ok to test e59936e |
What and why
Problem. With
policy.generation.dynamo: true,async_rl.generation_fleet_healthwas refused at startup. The Dynamo frontends pick engines themselves, so they would keep routing to a quarantined shard, and a restarted shard would never register.Change. The SingleController now tells the generation backend which shards are in service (
GenerationInterface.set_serving_shards, a no-op by default). It does so on every fleet probe and once before generation resumes after a refit. Behind Dynamo,VllmGenerationmakes the frontends' routing match:A call through a frontend does not say which engine failed it. So for an engine served through Dynamo, the liveness probe also fails when the engine's endpoint stopped serving or vLLM reports its engine core dead.
sequenceDiagram participant SC as SingleController participant Gen as VllmGeneration participant E as Engine, shard 0 participant FE as Dynamo frontends Note over E: process dies SC->>Gen: set_serving_shards({1}, quarantined={0}) Note over FE: shard 0's record lapses with its etcd lease SC->>Gen: restart_shard(0) Note over E: new process, no Dynamo endpoint yet SC->>E: refit SC->>Gen: set_serving_shards({0, 1}) Gen->>E: start the Dynamo endpoint E->>FE: register SC->>Gen: resume generationNative vLLM behaves as before: the hook is a no-op without Dynamo, and
is_alivestill returnsTruethere (the base method only gains a-> boolannotation).No config key is added or changed.
Limits, also listed in
docs/guides/dynamo-generation.md:Replaces #4955, which is stacked on the unmerged #4954 and edits files that
mainhas since replaced.Issues
None.
Convergence / perf / functionality proof
tests/functional/grpo_sc_generation_shard_recovery.shon one GB200 node (4 GPUs). CI's 2-GPU runners skip this test, so it was run by hand. Each run finished all 24 steps.KILL_DURING_REFIT=true RESTART_DEAD_SHARDS=true)RESTART_DEAD_SHARDS=true)The first run is on this head. The other three ran before the review fixes, which rewrote the routing code.
A local check against real Dynamo 1.8 frontends (2 GPUs, two Qwen3-0.6B shards, no trainer) passes 32 of 32 assertions on this head:
The Dynamo lane's first fast line, now with fleet health on, passes on 2 GPUs. Unit tests, ruff and pyrefly pass on this head.
Needs upstream changes
None.
PR commands and CI
CI:Lfast: the default for most PRs. Runs a fast test subset.CI:L1: dependency or container changes (pyproject.toml,uv.lock,Dockerfile) or broad core changes. Builds a new image and runs unit and functional tests.CI:docs: docs-only changes. Runs doc tests only./ok to test <full-commit-sha>: start CI for that commit. Post again after each push./review: automated review comments. Addmode=strictfor a stricter review,reset=truefor a fresh full review./resolve-conflict: Autobot mergesmaininto this PR and resolves the conflicts. PRs from forks must allow edits by maintainers./review-pr-team <pr-number>for a team review before you ask for human review.🤖 Generated with Claude Code