Skip to content

Commit

Permalink
try and catch for non continuous tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Malyshev committed Oct 4, 2024
1 parent 2b25a0c commit cfe23d8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vllm/model_executor/layers/tuned_gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ def mm(self, inp, weights, bias=None):
# uses this for linear units. However, sampler
# will use torch.matmul with 2 dimensions only
if inp.dim() == 3:
inp_view = inp.reshape(-1, inp.size(-1))
batched = True
try:
inp_view = inp.view(-1, inp.size(-1))
batched = True
except RuntimeError:
return F.linear(inp, weights, bias)
else:
inp_view = inp
batched = False
Expand Down

0 comments on commit cfe23d8

Please sign in to comment.