From 58aa1e3d2692250c6bb24a0f852e3cb8e809a14f Mon Sep 17 00:00:00 2001 From: Tommy Asai <147074725+tommy-asai-sonarsource@users.noreply.github.com> Date: Tue, 18 Aug 2026 01:58:02 +0200 Subject: [PATCH] [Bugfix][SM120][MLA] Disable dense prefill for FlashInfer sparse MLA (#51395) Signed-off-by: tommy-asai-sonarsource Co-authored-by: Roger Wang --- tests/v1/attention/test_flashinfer_sparse_mla_sm120_api.py | 7 +++++++ .../attention/backends/mla/flashinfer_mla_sparse_sm120.py | 1 + 2 files changed, 8 insertions(+) diff --git a/tests/v1/attention/test_flashinfer_sparse_mla_sm120_api.py b/tests/v1/attention/test_flashinfer_sparse_mla_sm120_api.py index 12a8cf5cbc..724c8874b9 100644 --- a/tests/v1/attention/test_flashinfer_sparse_mla_sm120_api.py +++ b/tests/v1/attention/test_flashinfer_sparse_mla_sm120_api.py @@ -34,6 +34,13 @@ def test_sm120_backend_uses_dedicated_backend_name() -> None: ) +def test_sm120_backend_uses_sparse_mqa_for_prefill() -> None: + impl_cls = FlashInferMLASparseSM120Backend.get_impl_cls() + + assert impl_cls.is_sparse + assert not impl_cls.supports_dense_mha_prefill + + def test_v32_glm_sm120_backend_accepts_glm_block_size( monkeypatch, ) -> None: diff --git a/vllm/v1/attention/backends/mla/flashinfer_mla_sparse_sm120.py b/vllm/v1/attention/backends/mla/flashinfer_mla_sparse_sm120.py index 9db696a39c..4de2c2f53f 100644 --- a/vllm/v1/attention/backends/mla/flashinfer_mla_sparse_sm120.py +++ b/vllm/v1/attention/backends/mla/flashinfer_mla_sparse_sm120.py @@ -33,6 +33,7 @@ class FlashInferMLASparseSM120Impl(MLAAttentionImpl[FlashInferMLASparseMetadata] """SM120 FlashInfer sparse-MLA implementation.""" is_sparse = True + supports_dense_mha_prefill = False def __init__( self,