[Bugfix][DP] Don't assume the engines started when forwarding a wake (#51481)

Signed-off-by: aoshen02 <aoshen@inferact.ai>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
aoshen02
2026-08-18 13:49:35 -07:00
committed by GitHub
co-authored by Claude Opus 5
parent 6a391a931a
commit 7ddb50788d
3 changed files with 155 additions and 2 deletions
+4 -2
View File
@@ -358,8 +358,10 @@ class DPCoordinatorProc:
# is handled by all the engines.
engine_to_exclude = None
engines_running = True
wave_state_changed = True
# engines_running is only set from the engines'
# own notifications; a paused engine discards
# START_DP_WAVE, so sending it is not evidence
# that the engines are running.
self._send_start_wave(
publish_back, current_wave, engine_to_exclude
)
+14
View File
@@ -2156,6 +2156,7 @@ class DPEngineCoreProc(EngineCoreProc):
# Loop until process is sent a SIGINT or SIGTERM
while self._handle_shutdown():
# 1) Poll the input queue until there is work to do.
was_running = self.engines_running
self._process_input_queue()
# Publish request counts before and after GPU step to ensure freshness.
self._maybe_publish_request_counts()
@@ -2216,6 +2217,19 @@ class DPEngineCoreProc(EngineCoreProc):
# Increment wave count and reset step counter.
self.current_wave += 1
self.step_counter = 0
elif (
not was_running
and self.has_coordinator
and self.dp_rank == 0
and not self.pending_pause
):
# Mirror of the wave_complete notification above: the
# coordinator must observe this edge too rather than assume
# that a START_DP_WAVE it sent was acted upon, since a paused
# engine discards it.
self.output_queue.put_nowait(
(-1, EngineCoreOutputs(start_wave=self.current_wave))
)
raise SystemExit