recoverssm: allow pipeline parallelism for Qwen4Exp on the V2 runner
Upstream RecoverSSM commits a step in the same step's postprocess, hence PP=1. Under pipeline parallelism a non-last rank learns a step's accepted counts only when the PP broadcast arrives pp_size steps later, while later builds overwrite the persistent commit inputs. The commit is now deferred with its own copy of those inputs, and the PP=1 check is lifted for Qwen4Exp on Model Runner V2. Config and CPU tests cover the deferral. Co-Authored-By: Hinata <hinata@idihore.id> Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
@@ -1239,6 +1239,11 @@ class GPUModelRunner(LoRAModelRunnerMixin):
|
||||
self.req_states.draft_tokens
|
||||
)
|
||||
if outputs is not None:
|
||||
# Restore the step's deferred model state (RecoverSSM commits)
|
||||
# so this postprocess commits the step that sampled them.
|
||||
self.model_state.restore_deferred_state(
|
||||
outputs.pop("deferred_state", None)
|
||||
)
|
||||
self.postprocess_sampled(**outputs)
|
||||
|
||||
def add_requests(self, scheduler_output: SchedulerOutput) -> None:
|
||||
@@ -2359,6 +2364,12 @@ class GPUModelRunner(LoRAModelRunnerMixin):
|
||||
):
|
||||
raise RuntimeError("PLE test fault: exc_async_output")
|
||||
all_decode_next = self.pp_handler.receive(input_batch)
|
||||
# The accepted counts of this step arrive pp_size steps later; keep
|
||||
# the state their postprocess needs with this step's pending entry
|
||||
# (before the immediate prefill-chunk postprocess below).
|
||||
self.pp_handler.attach_deferred_state(
|
||||
self.model_state.detach_deferred_state()
|
||||
)
|
||||
# Optimistically update num_computed_tokens for entire batch here.
|
||||
# Will be adjusted for rejections if necessary in update_requests.
|
||||
self.postprocess_num_computed_tokens(input_batch)
|
||||
|
||||
Reference in New Issue
Block a user