@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 5e5646e206
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 12, 04:45 UTC

[BUGFIX] llama_4_scaling wrongly passed to DeepseekAttention (#29908)

Signed-off-by: juliendenize <julien.denize@mistral.ai>

Julien Denize committed Dec 2, 2025 at 23:51 UTC 5e5646e2064f925f97ff533aa688a43834e9ff96
1 file changed +10 -5
vllm/model_executor/models/deepseek_v2.py
+10 -5
@@ -1135,6 +1135,8 @@ class DeepseekV2DecoderLayer(nn.Module):
1135 dim == 0 for dim in (qk_nope_head_dim, qk_rope_head_dim)
1136 )
1137
1138 + self.use_mha = use_mha
1139 +
1140 if use_mha:
1141 attn_cls = DeepseekAttention
1142 elif model_config.use_mla:
@@ -1196,11 +1198,14 @@ class DeepseekV2DecoderLayer(nn.Module):
1198 hidden_states = self.input_layernorm(hidden_states)
1199 else:
1200 hidden_states, residual = self.input_layernorm(hidden_states, residual)
1199 - hidden_states = self.self_attn(
1200 - positions=positions,
1201 - hidden_states=hidden_states,
1202 - llama_4_scaling=llama_4_scaling,
1203 - )
1201 +
1202 + attn_kwargs = {
1203 + "positions": positions,
1204 + "hidden_states": hidden_states,
1205 + }
1206 + if not self.use_mha:
1207 + attn_kwargs["llama_4_scaling"] = llama_4_scaling
1208 + hidden_states = self.self_attn(**attn_kwargs)
1209
1210 if (
1211 not isinstance(self.self_attn, DeepseekAttention)