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:
2026-10-09 20:08:56 +07:00
co-authored by Hinata
parent 8918d40b59
commit 812d662602
10 changed files with 254 additions and 7 deletions
+4
View File
@@ -1138,6 +1138,10 @@ def _teardown_profiling_state(runner: "GPUModelRunner") -> None:
# profiling KV cache.
if (recoverssm := getattr(runner.model_state, "recoverssm", None)) is not None:
recoverssm.reset()
# Under PP the non-last ranks keep detached RecoverSSM steps on the pending
# PP entries; they reference the profiling KV cache just the same.
if (pp_handler := getattr(runner, "pp_handler", None)) is not None:
pp_handler.drop_deferred_states()
# Invalidate the align-mode Mamba group metadata cached from the
# profiling KVCacheConfig: the real (e.g. PP-projected) config may
# place Mamba layers into a different group layout, so it must be