@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / cb2263218e
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 5, 23:30 UTC

[Bugfix][Minor] Fix potential NameError in mamba backend selector and misc typos (#35886)

Signed-off-by: Li <chuali@amd.com>

Chuan (Richard) Li committed Mar 26, 2026 at 08:59 UTC cb2263218e6638cc1982d7f7a0be735e8cc46ab5
4 files changed +8 -5
vllm/model_executor/models/kimi_k25.py
+1 -1
@@ -369,7 +369,7 @@ class KimiK25ForConditionalGeneration(
369 target_dtype = next(self.vision_tower.parameters()).dtype
370 pixel_values = pixel_values.to(target_dtype)
371 assert isinstance(grid_thws, torch.Tensor), (
372 - f"expect grid_thws to be a tensor, get {type(grid_thws)}"
372 + f"expect grid_thws to be a tensor, got {type(grid_thws)}"
373 )
374 # In some cases (e.g. with merger), grid_thws has an extra middle dimension
375 grid_thws = grid_thws.reshape(-1, grid_thws.shape[-1])
vllm/v1/attention/backends/flex_attention.py
+4 -1
@@ -749,7 +749,10 @@ class FlexAttentionMetadataBuilder(AttentionMetadataBuilder[FlexAttentionMetadat
749 prefix_kv_lens = None
750 suffix_kv_lens = None
751 if use_cascade:
752 - raise NotImplementedError("Not yet my friend")
752 + raise NotImplementedError(
753 + "Cascade prefix attention is not yet implemented "
754 + "for FlexAttention backend"
755 + )
756
757 block_size = self.kv_cache_spec.block_size
758 max_possible_seq_len = self.model_config.max_model_len
vllm/v1/attention/backends/utils.py
+1 -1
@@ -253,7 +253,7 @@ def make_local_attention_virtual_batches(
253 # seqlens_q_local = [2, 2, 1, 4, 4, 1, 4, 1]
254 #
255 # First Get batched arange. (E.g., [2, 4, 2] -> [0, 1, 0, 1, 2, 3, 0, 1])
256 - # (TODO: max a utility to share this code with _prepare_inputs)
256 + # (TODO: make a utility to share this code with _prepare_inputs)
257 # arange step 1. [2, 4, 2] -> [2, 6, 8]
258 cu_num_blocks = np.cumsum(local_blocks)
259 virtual_batches = cu_num_blocks[-1]
vllm/v1/attention/selector.py
+2 -2
@@ -149,8 +149,8 @@ def _cached_get_mamba_attn_backend(
149 selected_backend = MambaAttentionBackendEnum[backend_name]
150 except KeyError as e:
151 raise ValueError(
152 - f"Invalid mamba attention backend type: '{backend_name}'. Valid "
153 - f"backends are: {list(MambaAttentionBackendEnum.__members__.keys())}"
152 + f"Invalid mamba attention backend type: '{mamba_type}'. Valid "
153 + f"types are: {list(MAMBA_TYPE_TO_BACKEND_MAP.keys())}"
154 ) from e
155
156 mamba_attn_backend = selected_backend.get_class()