[Bugfix] FLASHINFER_MLA_SPARSE_SM120 compatibility with GLM-5 NVFP4 (#46506)
Gabriel Wu committed
Jun 26, 2026 at 00:12 UTC
8fa36fbbebdf838953a904531c86fcd05896a4c8
1 file changed
+6
-4
vllm/v1/attention/backends/mla/flashinfer_mla_sparse_sm120.py
+6
-4
@@ -81,11 +81,13 @@ class FlashInferMLASparseSM120Impl(SparseMLAAttentionImpl[FlashInferMLASparseMet
81
)
82
self.kv_scale_format = _kv_scale_format_for_model(model_type)
83
84
- assert indexer is not None, (
85
- "FLASHINFER_MLA_SPARSE_SM120 requires a sparse-MLA indexer "
86
- "(model with index_topk in its config)."
84
+ # Skip-topk layers are built with indexer=None and get the shared
85
+ # buffer via mla_args instead (cf. FLASHMLA_SPARSE).
86
+ self.topk_indices_buffer: torch.Tensor | None = (
87
+ indexer.topk_indices_buffer
88
+ if indexer is not None
89
+ else mla_args.get("topk_indices_buffer")
90
)
88
- self.topk_indices_buffer: torch.Tensor | None = indexer.topk_indices_buffer
91
from vllm.utils.flashinfer import has_flashinfer_sparse_mla_sm120
92
93
if not has_flashinfer_sparse_mla_sm120():