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:
@@ -163,6 +163,19 @@ class ModelState(ABC):
|
||||
) -> None:
|
||||
return None
|
||||
|
||||
def detach_deferred_state(self) -> Any:
|
||||
"""Non-last PP rank, after this step's forward: hand over any state the
|
||||
step's postprocess needs once its sampled tokens arrive (pp_size steps
|
||||
later). The PP handler keeps it with the step's pending entry. None by
|
||||
default (nothing deferred)."""
|
||||
return None
|
||||
|
||||
def restore_deferred_state(self, state: Any) -> None:
|
||||
"""Counterpart of `detach_deferred_state`, called right before the
|
||||
deferred postprocess of the step that detached `state`."""
|
||||
if state is not None:
|
||||
raise RuntimeError(f"{type(self).__name__} cannot restore {state!r}")
|
||||
|
||||
@abstractmethod
|
||||
def prepare_inputs_embeds(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user