[K3 Bug] Fix Kimi-K3 RecoverSSM startup failure 'MambaAttentionBackendEnum.GDN_ATTN declares 4 states, but provides 2 state copy funcs' (#54634)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-08-31 23:22:49 +00:00
committed by GitHub
parent 3a2ed6cbae
commit 91752b7a3e
+3 -2
View File
@@ -713,9 +713,10 @@ def validate_mamba_state_copy_funcs(
f"missing state copy funcs for {mamba_spec.mamba_type}"
)
state_copy_funcs = copy_funcs[mamba_spec.mamba_type]
assert len(state_copy_funcs) == len(mamba_spec.shapes), (
assert 0 < len(state_copy_funcs) <= len(mamba_spec.shapes), (
f"{mamba_spec.mamba_type} declares {len(mamba_spec.shapes)} states, "
f"but provides {len(state_copy_funcs)} state copy funcs"
f"but provides {len(state_copy_funcs)} state copy funcs; expected "
"a non-empty copyable prefix"
)