Skip to content

Commit

Permalink
support internvl and llava
Browse files Browse the repository at this point in the history
Signed-off-by: MengqingCao <[email protected]>
  • Loading branch information
MengqingCao committed Dec 24, 2024
1 parent 93bb53c commit 27244b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion vllm/attention/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def forward(
key,
value,
scale=self.scale)
out = out.transpose(1, 2)
# TODO (cmq): revert me after op `transpose` in torch-npu is fixed
out = out.transpose(1, 2).contiguous()
return out.view(bsz, q_len, -1)


Expand Down
3 changes: 2 additions & 1 deletion vllm/model_executor/models/intern_vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ def forward(self, x: torch.Tensor) -> torch.Tensor:
v = v.transpose(1, 2)

x = F.scaled_dot_product_attention(q, k, v, scale=self.scale)
x = x.transpose(1, 2).view(B, N, -1)
# TODO (cmq): revert me after op `transpose` in torch-npu is fixed
x = x.transpose(1, 2).contiguous().view(B, N, -1)

x = self.proj(x)
return x
Expand Down

0 comments on commit 27244b2

Please sign in to comment.