@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 9fb27dd3b3
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 8, 22:45 UTC

[MM] Align the prefix of MMEncoderAttention with Attention (#33750)

Signed-off-by: shen-shanshan <467638484@qq.com>

Shanshan Shen committed Feb 4, 2026 at 12:07 UTC 9fb27dd3b3530cbf958a24ee2dcfc907acbf5455
17 files changed +17 -15
vllm/model_executor/models/aimv2.py
+1 -1
@@ -130,7 +130,7 @@ class AIMv2Attention(nn.Module):
130 self.num_heads_per_partition,
131 self.head_dim,
132 self.scale,
133 - prefix=prefix,
133 + prefix=f"{prefix}.attn",
134 )
135
136 def forward(self, x: torch.Tensor) -> torch.Tensor:
vllm/model_executor/models/blip.py
+1 -1
@@ -126,7 +126,7 @@ class BlipAttention(nn.Module):
126 self.num_heads_per_partition,
127 self.head_dim,
128 self.scale,
129 - prefix=prefix,
129 + prefix=f"{prefix}.attn",
130 )
131
132 def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
vllm/model_executor/models/glm4_1v.py
+1 -1
@@ -296,7 +296,7 @@ class Glm4vVisionAttention(nn.Module):
296 num_heads=self.num_attention_heads_per_partition,
297 head_size=self.hidden_size_per_attention_head,
298 scale=self.hidden_size_per_attention_head**-0.5,
299 - prefix=prefix,
299 + prefix=f"{prefix}.attn",
300 )
301
302 self.apply_rotary_emb = ApplyRotaryEmb(enforce_enable=True)
vllm/model_executor/models/glm4v.py
+1 -1
@@ -139,7 +139,7 @@ class EVA2CLIPAttention(nn.Module):
139 self.num_heads_per_rank,
140 self.head_dim,
141 self.scale,
142 - prefix=prefix,
142 + prefix=f"{prefix}.attn",
143 )
144 self.output_dropout = torch.nn.Dropout(config.dropout_prob)
145
vllm/model_executor/models/glm_ocr.py
+1
@@ -137,6 +137,7 @@ class GlmOcrVisionAttention(nn.Module):
137 num_heads=self.num_attention_heads_per_partition,
138 head_size=self.hidden_size_per_attention_head,
139 scale=self.hidden_size_per_attention_head**-0.5,
140 + prefix=f"{prefix}.attn",
141 )
142 self.apply_rotary_emb = ApplyRotaryEmb(enforce_enable=True)
143
vllm/model_executor/models/idefics2_vision_model.py
+1 -1
@@ -166,7 +166,7 @@ class Idefics2VisionAttention(nn.Module):
166 self.num_heads_per_partition,
167 self.head_dim,
168 self.scale,
169 - prefix=prefix,
169 + prefix=f"{prefix}.attn",
170 )
171
172 def forward(
vllm/model_executor/models/intern_vit.py
+1 -1
@@ -215,7 +215,7 @@ class InternParallelAttention(nn.Module):
215 self.num_heads_per_partition,
216 self.head_dim,
217 self.scale,
218 - prefix=prefix,
218 + prefix=f"{prefix}.attn",
219 )
220
221 def _apply_qk_norm(self, q: torch.Tensor, k: torch.Tensor):
vllm/model_executor/models/interns1_vit.py
+1 -1
@@ -220,7 +220,7 @@ class InternSdpaAttention(nn.Module):
220 self.num_heads,
221 self.head_dim,
222 self.scale,
223 - prefix=prefix,
223 + prefix=f"{prefix}.attn",
224 )
225
226 def forward(self, x: torch.Tensor) -> torch.Tensor:
vllm/model_executor/models/mllama4.py
+1 -1
@@ -257,7 +257,7 @@ class Llama4VisionAttention(nn.Module):
257 self.num_local_heads,
258 self.head_dim,
259 self.scaling,
260 - prefix=prefix,
260 + prefix=f"{prefix}.attn",
261 )
262
263 if use_data_parallel:
vllm/model_executor/models/molmo.py
+1 -1
@@ -235,7 +235,7 @@ class MultiHeadDotProductAttention(nn.Module):
235 self.head_dim,
236 self.scale,
237 num_kv_heads=self.num_kv_heads,
238 - prefix=prefix,
238 + prefix=f"{prefix}.attn",
239 )
240
241 def forward(
vllm/model_executor/models/molmo2.py
+1 -1
@@ -611,7 +611,7 @@ class ImagePoolingAttention(nn.Module):
611 self.head_dim,
612 self.scale,
613 num_kv_heads=self.num_kv_heads,
614 - prefix=prefix,
614 + prefix=f"{prefix}.attn",
615 )
616
617 def forward_sdpa(
vllm/model_executor/models/openpangu_vl.py
+1
@@ -125,6 +125,7 @@ class OpenPanguVisionAttention(nn.Module):
125 num_heads=self.num_attention_heads_per_partition,
126 head_size=self.hidden_size_per_attention_head,
127 scale=self.hidden_size_per_attention_head**-0.5,
128 + prefix=f"{prefix}.attn",
129 )
130 self.apply_rotary_emb = ApplyRotaryEmb(enforce_enable=True)
131
vllm/model_executor/models/qwen2_5_vl.py
+1 -1
@@ -345,7 +345,7 @@ class Qwen2_5_VisionAttention(nn.Module):
345 num_heads=self.num_attention_heads_per_partition,
346 head_size=self.hidden_size_per_attention_head,
347 scale=self.hidden_size_per_attention_head**-0.5,
348 - prefix=prefix,
348 + prefix=f"{prefix}.attn",
349 )
350
351 self.apply_rotary_emb = ApplyRotaryEmb(enforce_enable=True)
vllm/model_executor/models/qwen2_vl.py
+1 -1
@@ -319,7 +319,7 @@ class Qwen2VisionAttention(nn.Module):
319 num_heads=self.num_attention_heads_per_partition,
320 head_size=self.hidden_size_per_attention_head,
321 scale=self.hidden_size_per_attention_head**-0.5,
322 - prefix=prefix,
322 + prefix=f"{prefix}.attn",
323 )
324
325 self.apply_rotary_emb = ApplyRotaryEmb(enforce_enable=True)
vllm/model_executor/models/qwen3_omni_moe_thinker.py
+1 -1
@@ -194,7 +194,7 @@ class Qwen3OmniMoeAudioAttention(nn.Module):
194 num_heads=self.num_local_heads,
195 head_size=self.head_dim,
196 scale=self.scaling,
197 - prefix=prefix,
197 + prefix=f"{prefix}.attn",
198 )
199
200 def forward(
vllm/model_executor/models/step3_vl.py
+1 -1
@@ -763,7 +763,7 @@ class Step3VisionAttention(nn.Module):
763 self.num_heads,
764 self.head_dim,
765 self.scale,
766 - prefix=prefix,
766 + prefix=f"{prefix}.attn",
767 )
768
769 def forward(
vllm/model_executor/models/step_vl.py
+1 -1
@@ -224,7 +224,7 @@ class PerceptionEncoderVisionAttention(nn.Module):
224 self.num_heads,
225 self.head_dim,
226 self.scale,
227 - prefix=prefix,
227 + prefix=f"{prefix}.attn",
228 )
229 self.rope = PerceptionEncoderRope2D(
230 dim=self.head_dim,