Repository navigation
Retire engines that died during training before the weight update - #2552
Open
GaokaiZhang wants to merge 1 commit into
Open
GaokaiZhang wants to merge 1 commit into
GaokaiZhang wants to merge 1 commit into
Conversation
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.
4 tasks done
This branch has not been 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.
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 nextupdate_weightssends itpause_generation, the request fails withConnectionRefusedError, 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_injectionrunssimulate_crashat the start ofgenerateand checks the monitors immediately, so that engine is retired long before the weight update.Change
recover_updatable_enginesrunscheck_onceof every monitor before it starts replacement engines. It is the checkfinish_rolloutruns: onehealth_generaterequest per engine at each weight update (under 1 s with two engines). The Megatron actor callsrecover_updatable_enginesfromupdate_weights(megatron_utils/actor.py:637), before its updater sends the first control request. 5 lines inslime/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, thenrecover()runs with its slot empty. Fails onmain(1 failed, 23 passedin 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 nextupdate_weights. With the change, the check reportsHealth check failed for engine 0: ... ConnectionRefusedError1 s into the sync, the sync relaunches the engine (Recovered 1 dead rollout engines), and the run trains 8 of 8 steps.