[Perf] Publish the WAR read-done event at DSPARK verify (#34816)
This commit is contained in:
@@ -506,7 +506,11 @@ class DeepseekV4AttnBackend(
|
||||
|
||||
def shared_read_boundary(self, forward_mode: ForwardMode) -> SharedReadBoundary:
|
||||
# Breakable-graph verify rereads shared state across segments.
|
||||
# DSPARK verify replays one full (non-breakable) graph that honors the
|
||||
# out-graph/in-graph init contract, so the base IN_REPLAY bound holds.
|
||||
if forward_mode.is_target_verify():
|
||||
if self.model_runner.spec_algorithm.is_dspark():
|
||||
return SharedReadBoundary.IN_REPLAY
|
||||
return SharedReadBoundary.POST_REPLAY
|
||||
return super().shared_read_boundary(forward_mode)
|
||||
|
||||
|
||||
@@ -128,8 +128,10 @@ class SpeculativeAlgorithm(Enum):
|
||||
return self.is_dflash_family()
|
||||
|
||||
def is_war_publish_phase(self, forward_mode) -> bool:
|
||||
# The step's last shared-buffer-reading phase owns the WAR read-done publish.
|
||||
if self.is_dflash_family():
|
||||
# The step's last shared-buffer-reading phase owns the WAR read-done
|
||||
# publish. DSPARK has no draft_extend: its draft samples inside the
|
||||
# verify graph, so verify is that last phase.
|
||||
if self.is_dflash_family() or self.is_dspark():
|
||||
return forward_mode.is_target_verify()
|
||||
return forward_mode.is_draft_extend_v2()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user