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 14, 05:30 UTC
[Bugfix] Fix interns1-vit qk norm code path (#27480)
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Isotr0py committed
Oct 25, 2025 at 01:43 UTC
acc78aeb88c8eeec08b1e484430cbdb668a6516f
1 file changed
+3
-4
vllm/model_executor/models/interns1_vit.py
+3
-4
@@ -217,16 +217,15 @@ class InternSdpaAttention(nn.Module):
217
self.attn = MultiHeadAttention(self.num_heads, self.head_dim, self.scale)
218
219
def forward(self, x: torch.Tensor) -> torch.Tensor:
220
- B, N, C = x.shape
220
+ """x shape: (B, N, C)"""
221
222
q = self.q_proj(x)
223
k = self.k_proj(x)
224
v = self.v_proj(x)
225
226
if self.qk_normalization:
227
- B_, N_, H_, D_ = q.shape
228
- q = self.q_norm(q.flatten(-2, -1)).view(B_, N_, H_, D_)
229
- k = self.k_norm(k.flatten(-2, -1)).view(B_, N_, H_, D_)
227
+ q = self.q_norm(q)
228
+ k = self.k_norm(k)
229
230
# Use unified MultiHeadAttention with automatic backend selection
231
x = self.attn(q, k, v)