From 9f1e6ebfda70b72a48da4a90d14fc23d58c33378 Mon Sep 17 00:00:00 2001 From: AlpinDale Date: Tue, 4 Aug 2026 02:36:40 +0430 Subject: [PATCH 1/3] fix(attention): restore MLA DCP query state Signed-off-by: AlpinDale --- aphrodite/model_executor/layers/mla.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aphrodite/model_executor/layers/mla.py b/aphrodite/model_executor/layers/mla.py index 0075419927..f528209ca8 100644 --- a/aphrodite/model_executor/layers/mla.py +++ b/aphrodite/model_executor/layers/mla.py @@ -98,6 +98,10 @@ def __init__( # the topk_tokens buffer written by a previous layer in the same pass. # Refer: https://arxiv.org/abs/2603.12201 for more details. self.skip_topk = skip_topk + # qrep is active when the query projection is a DCP-group-sharded layer + # that materializes the full group head set locally. + q_proj_layer = self.q_b_proj if self.q_lora_rank is not None else self.q_proj + self.dcp_q_replicate = getattr(q_proj_layer, "qrep_active", False) if self.indexer is not None: assert hasattr(self.indexer, "topk_tokens") self.topk_tokens = self.indexer.topk_tokens @@ -115,6 +119,7 @@ def __init__( quant_config=quant_config, prefix=f"{prefix}.attn", kv_b_proj=self.kv_b_proj, + dcp_q_replicate=self.dcp_q_replicate, use_sparse=self.is_sparse, indexer=self.indexer, topk_indices_buffer=mla_modules.topk_indices_buffer, From 1df15bdbdb355010d04f58cd52aacc73d6b9798c Mon Sep 17 00:00:00 2001 From: AlpinDale Date: Tue, 4 Aug 2026 03:18:03 +0430 Subject: [PATCH 2/3] fix(attention): default masked MLA capability off Signed-off-by: AlpinDale --- aphrodite/model_executor/layers/attention/mla_attention.py | 7 +++++-- aphrodite/v1/attention/backend.py | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/aphrodite/model_executor/layers/attention/mla_attention.py b/aphrodite/model_executor/layers/attention/mla_attention.py index 9e8a9a1d8b..bbaf8a910d 100644 --- a/aphrodite/model_executor/layers/attention/mla_attention.py +++ b/aphrodite/model_executor/layers/attention/mla_attention.py @@ -767,11 +767,14 @@ def forward_impl( num_mha_tokens = q.size(0) - num_mqa_tokens if self.impl.is_sparse and num_mha_tokens > 0: + impl_forward_mha = getattr(type(self.impl), "forward_mha", None) + mha_available = impl_forward_mha is not MLAAttentionImpl.forward_mha prefill = getattr(attn_metadata, "prefill", None) - use_dense_mha = getattr(prefill, "use_dense_mha", False) + use_dense_mha = mha_available and getattr(prefill, "use_dense_mha", False) prefill_max_seq_len = attn_metadata.prefill_max_seq_len # type: ignore[attr-defined] use_masked_mha = ( - self.prefill_backend is not None + mha_available + and self.prefill_backend is not None and self.impl.masked_mha_available # type: ignore[attr-defined] and self.impl.dcp_world_size <= 1 and prefill is not None diff --git a/aphrodite/v1/attention/backend.py b/aphrodite/v1/attention/backend.py index 24f40058b8..c0a77282c3 100644 --- a/aphrodite/v1/attention/backend.py +++ b/aphrodite/v1/attention/backend.py @@ -972,6 +972,10 @@ class MLAAttentionImpl(AttentionImplBase[T], Generic[T]): """MLA attention implementation with forward_mqa and forward_mha methods.""" supports_pcp: bool = True + # Masked sparse-MHA prefill is an optional capability implemented by + # SparseMLACommonImpl. Platform-specific sparse MLA backends inherit the + # safe default and continue to route prefills through MQA. + masked_mha_available: bool = False @abstractmethod def __init__( From 02569a69749442ab0cf847429aec67a2b22e2344 Mon Sep 17 00:00:00 2001 From: AlpinDale Date: Tue, 4 Aug 2026 03:41:13 +0430 Subject: [PATCH 3/3] fix(cuda): disable DeepGEMM on SM12x Signed-off-by: AlpinDale --- aphrodite/platforms/cuda.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aphrodite/platforms/cuda.py b/aphrodite/platforms/cuda.py index 96b921c47a..f1893a9784 100644 --- a/aphrodite/platforms/cuda.py +++ b/aphrodite/platforms/cuda.py @@ -694,10 +694,12 @@ def support_static_graph_mode(cls) -> bool: @classmethod def support_deep_gemm(cls) -> bool: - """Currently, only Hopper and Blackwell GPUs are supported.""" - return ( - cls.is_device_capability(90) or cls.is_device_capability_family(100) or cls.is_device_capability_family(120) - ) + """Return whether DeepGEMM is validated on this CUDA architecture. + + Consumer Blackwell (SM12x) is excluded. The available DeepGEMM + revisions either lack its kernels or produce incorrect results there. + """ + return cls.is_device_capability(90) or cls.is_device_capability_family(100) @classmethod def is_integrated_gpu(cls, device_id: int = 0) -> bool: