PR #5024 · reviewed at ea1a6e22, re-checked at 9df434a7 (the reviewed files are unchanged since d2e22762) · review still pending · Megatron-LM e0a4bfed
Two pages on this PR, one question each. This one: the report step at shutdown.
confirm_terminated(address, owner): it tells a prefill coordinator that the owner is gone, so it unpins the blocks. Dotted words have a short explanation: hover or tap them.Example: 1 prefill engine P0, whose coordinator answered the address lookup but then hangs; 3 decode engines D0–D2; the default control_timeout_s = 600 (C1 removes this key; with any per-call timeout T, the wait is decode engines × T). Each report waits up to 600 s in the worker plus a 10 s margin in the driver, and confirm_terminated waits its full timeout with no retry when nobody answers.
Where the wait comes from. Not from stopping decode: that is usually quick. It comes from the reports:
Why the report changes nothing here: upstream keeps owner IDs only in the coordinator's memory and says
"Source coordinators and their engines must restart as a single lifecycle unit … Ownership is not replicated."
So stopping P0 one line later frees every block the report would have freed. The hook exists for replacing one failed decode engine while prefill keeps running, and it requires every decode rank to have exited first. Here the decode kill is issued but not awaited, as the PR's own docstring says.
Where the fix lands: RL only, two files. dynamo_generation.py (shutdown and three helpers) and dynamo_worker_mixin.py (three worker reads). No Megatron-LM change: the hook stays for a later PR that replaces a decode engine live.
Nothing below is implemented. The report is deleted, not made faster: nothing replaces it, because stopping prefill already frees the blocks.
Shutdown, after the fix (proposed, not run) · driver process
# driver, MegatronDynamoGeneration.shutdown owners = read handoff owner from each decode rank 0 for d in decode: stop(d) stop(every engine at once) # C3 + C11: cleanup ≤30 s, then kill; no role order for owner in owners: prefill0.confirm_decode_terminated(owner) for p in prefill: stop(p) # stopping prefill frees every kept block stop frontend, NATS, etcd
Delete too: _prefill_coordinator_addresses, _handoff_owners, _confirm_decode_terminated, and the worker's confirm_decode_terminated.
🔴 review comment C3 — dynamo_generation.py:1381
Mostly, it doesn't need to. At the end of a run nothing is saved here: partial checkpoints are taken while the run is live, not at shutdown. On main:
VllmGeneration.shutdown) asks every worker to clean up at once, waits at most 30 s, kills them all, then stops the services. No per-engine order, no report.Two things still need an explicit stop: the frontend, NATS and etcd, which run as their own processes outside Ray, and the engines' placement groups, if the Ray cluster outlives the run. C3 and C11 ask for exactly vLLM's model: one cleanup wave across every engine, then kill, then the services. A decode engine killed while copying from a prefill engine that is being killed too has nothing left to wait for, so no role order is needed.