Skip to content

Retire engines that died during training before the weight update - #2552

Open
GaokaiZhang wants to merge 1 commit into
THUDM:mainfrom
GaokaiZhang:retire-dead-engines-before-weight-update
Open

GaokaiZhang wants to merge 1 commit into
THUDM:mainfrom
GaokaiZhang:retire-dead-engines-before-weight-update

Conversation

@GaokaiZhang

@GaokaiZhang GaokaiZhang commented Nov 19, 2026 •

Copy link
Copy Markdown

Problem

The health monitors are paused from the end of a rollout (finish_rollout) to the weight update. An engine that dies in that window stays registered in the router and in the engine list. The next update_weights sends it pause_generation, the request fails with ConnectionRefusedError, and the run stops. With the fully-async rollout the periodic check does not help either: each resume restarts the first wait (600 s by default), so no periodic check runs when a rollout takes less than that. Details and the traceback: #2551.

The CI injection (--ci-test --use-fault-tolerance) does not show this: try_ci_fault_injection runs simulate_crash at the start of generate and checks the monitors immediately, so that engine is retired long before the weight update.

Change

recover_updatable_engines runs check_once of every monitor before it starts replacement engines. It is the check finish_rollout runs: one health_generate request per engine at each weight update (under 1 s with two engines). The Megatron actor calls recover_updatable_engines from update_weights (megatron_utils/actor.py:637), before its updater sends the first control request. 5 lines in slime/ray/serving.py, plus the test.

Test

tests/test_server_control.py::test_weight_update_recovery_retires_engine_dead_since_rollout: an engine that fails the check is unregistered and killed, then recover() runs with its slot empty. Fails on main (1 failed, 23 passed in the file), passes with the change (24 passed). ruff, black and isort pass on the two files.

End to end, in our private repository (slime 0.4.0 used directly, with these three files identical to main): a SIGKILL of one of two TP=4 engines 12-13 s into the training of step 2. Without the change the run exits at the next update_weights. With the change, the check reports Health check failed for engine 0: ... ConnectionRefusedError 1 s into the sync, the sync relaunches the engine (Recovered 1 dead rollout engines), and the run trains 8 of 8 steps.

The health monitors are paused from the end of a rollout to the weight
update. An engine that dies in that window stays registered: the update
sends it pause_generation, the request fails and the run stops. The CI
injection does not show this, because it shuts the engine down at the
rollout boundary, where the forced check retires it at once.

recover_updatable_engines now runs the forced check of every monitor
before it starts replacement engines. It is the check finish_rollout
runs: one health_generate request per engine at each weight update.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant