mirror of
https://github.com/vllm-project/vllm.git
synced 2025-10-20 14:53:52 +08:00
[Models][QwenVL] Remove unnecessary .contiguous()
calls (#27106)
Signed-off-by: Lukas Geiger <lukas.geiger94@gmail.com>
This commit is contained in:
@ -396,7 +396,7 @@ class Qwen2_5_VisionAttention(nn.Module):
|
||||
q, k, v = self.split_qkv(x)
|
||||
batch_size = q.shape[1]
|
||||
|
||||
q, k, v = (rearrange(x, "s b ... -> b s ...").contiguous() for x in (q, k, v))
|
||||
q, k, v = (rearrange(x, "s b ... -> b s ...") for x in (q, k, v))
|
||||
if rotary_pos_emb is not None:
|
||||
# [2 * b, s, heads, head_dim]
|
||||
qk_concat = torch.cat([q, k], dim=0)
|
||||
|
@ -423,7 +423,7 @@ class Qwen2VisionAttention(nn.Module):
|
||||
q, k, v = self.split_qkv(x)
|
||||
batch_size = q.shape[1]
|
||||
|
||||
q, k, v = (rearrange(x, "s b ... -> b s ...").contiguous() for x in (q, k, v))
|
||||
q, k, v = (rearrange(x, "s b ... -> b s ...") for x in (q, k, v))
|
||||
if rotary_pos_emb is not None:
|
||||
# [2 * b, s, heads, head_dim]
|
||||
qk_concat = torch.cat([q, k], dim=0)
|
||||
|
Reference in New Issue
Block a user