From 91752b7a3e0cd20ba2a41a65069ece1b29825ee5 Mon Sep 17 00:00:00 2001 From: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Date: Mon, 31 Aug 2026 19:22:49 -0400 Subject: [PATCH] [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 --- vllm/v1/worker/mamba_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vllm/v1/worker/mamba_utils.py b/vllm/v1/worker/mamba_utils.py index 53e46a9cf9..724c714057 100644 --- a/vllm/v1/worker/mamba_utils.py +++ b/vllm/v1/worker/mamba_utils.py @@ -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" )