Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions vllm/model_executor/layers/attention/mla_attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -2789,6 +2789,10 @@ def _concat_k_nope_k_pe(
Returns:
Tensor of shape [..., nope_dim + pe_dim]
"""
if k_pe.shape[-1] == 0:
# NoPE MLA: nothing to append, so no copy either.
return k_nope

Comment on lines +2874 to +2877
k = torch.empty(
(*k_nope.shape[:-1], k_nope.shape[-1] + k_pe.shape[-1]),
dtype=k_nope.dtype,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def _is_masked_mha_available(
if model_dims not in (
(128, 512, 128, 64, 128),
(64, 512, 192, 64, 256),
# GLM-5.3-Flash: NoPE, qk_head_dim 256 == the (192, 64, 256) kernel.
(64, 512, 256, 0, 256),
):
Comment on lines 111 to 116
return False
qk_head_dim = qk_nope_head_dim + qk_rope_head_dim
Expand Down
7 changes: 7 additions & 0 deletions vllm/v1/attention/backends/mla/prefill/flash_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,13 @@ def supports_mla_dimensions(cls, mla_dimensions: MLADimensions) -> bool:
qk_rope_head_dim=64,
v_head_dim=128,
),
# GLM-5.x NoPE layout: qk_head_dim 256 + 0 and v_head_dim 256 run
Comment thread
JaredforReal marked this conversation as resolved.
Resolved
# the same kernels as the (192, 64, 256) DeepSeek-V3.2 layout.
MLADimensions(
qk_nope_head_dim=256,
qk_rope_head_dim=0,
v_head_dim=256,
),
]

def __init__(
Expand Down
Loading