[Misc] Replace mamba_type string literals with MambaAttentionBackendEnum (#41188)

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
wangxiyuan
2026-05-11 03:59:36 +00:00
committed by GitHub
parent 7f95e66a11
commit 5536fc0c01
18 changed files with 64 additions and 58 deletions
@@ -14,6 +14,7 @@ import torch
from vllm.config.mamba import MambaBackendEnum, MambaConfig
from vllm.logger import init_logger
from vllm.v1.attention.backends.registry import MambaAttentionBackendEnum
from vllm.v1.attention.backends.utils import NULL_BLOCK_ID
from vllm.v1.kv_cache_interface import KVCacheConfig, MambaSpec
@@ -200,7 +201,8 @@ def initialize_mamba_ssu_backend(
"""
if not any(
isinstance(g.kv_cache_spec, MambaSpec)
and g.kv_cache_spec.mamba_type in ("mamba1", "mamba2")
and g.kv_cache_spec.mamba_type
in (MambaAttentionBackendEnum.MAMBA1, MambaAttentionBackendEnum.MAMBA2)
for g in kv_cache_config.kv_cache_groups
):
return