[Bugfix][Model] Fix crash loading Mamba/Mamba2 checkpoints without an `architectures` field (#46037)
Signed-off-by: Ting Sun <suntcrick@gmail.com> Signed-off-by: Ting SUN <suntcrick@gmail.com> Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Ting SUN committed
Jul 5, 2026 at 19:42 UTC
fb2faceacd7af2ea6aa51eed90f295c421c00ec5
1 file changed
+9
vllm/config/vllm.py
+9
@@ -1936,12 +1936,21 @@ class VllmConfig:
1936
if architecture is None:
1937
return
1938
1939
+ from vllm.model_executor.models import ModelRegistry
1940
from vllm.model_executor.models.config import (
1941
MODELS_CONFIG_MAP,
1942
HybridAttentionMambaModelConfig,
1943
)
1944
1945
cls = MODELS_CONFIG_MAP.get(architecture, None)
1946
+ if cls is None:
1947
+ # `architecture` may be an HF base-model name (e.g. "Mamba2Model"
1948
+ # when `architectures` is omitted); normalize to the resolved arch
1949
+ # so per-arch config hooks are not skipped.
1950
+ architecture = ModelRegistry._normalize_arch(
1951
+ architecture, self.model_config
1952
+ )
1953
+ cls = MODELS_CONFIG_MAP.get(architecture, None)
1954
if cls is not None:
1955
cls.verify_and_update_config(self)
1956