@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 9dd02d85ca
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 16, 02:00 UTC

[Bug] Fix usage of `.transpose()` and `.view()` consecutively. (#11979)

Siyuan Li committed Jan 13, 2025 at 14:24 UTC 9dd02d85ca801c99241317a8061bd025c726af93
2 files changed +2 -2
vllm/attention/layer.py
+1 -1
@@ -230,7 +230,7 @@ class MultiHeadAttention(nn.Module):
230 value,
231 scale=self.scale)
232 out = out.transpose(1, 2)
233 - return out.view(bsz, q_len, -1)
233 + return out.reshape(bsz, q_len, -1)
234
235
236 def unified_attention(
vllm/model_executor/models/intern_vit.py
+1 -1
@@ -271,7 +271,7 @@ class InternSdpaAttention(nn.Module):
271 v = v.transpose(1, 2)
272
273 x = F.scaled_dot_product_attention(q, k, v, scale=self.scale)
274 - x = x.transpose(1, 2).view(B, N, -1)
274 + x = x.transpose(1, 2).reshape(B, N, -1)
275
276 x = self.proj(x)
277 return x