Skip to content

Commit 93ee1c5

Browse files
rebkleedllehr-amd
authored andcommitted
Add handling for non-contiguous x
1 parent 25e4e87 commit 93ee1c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vllm/model_executor/layers/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ def rocm_unquantized_gemm_impl(
110110
from vllm.platforms.rocm import on_gfx9
111111
k = weight.shape[1]
112112
m = weight.shape[0]
113-
x_view = x.view(-1, x.size(-1))
113+
if x.is_contiguous():
114+
x_view = x.view(-1, x.size(-1))
115+
else:
116+
x_view = x.reshape(-1, x.size(-1))
114117
n = x_view.shape[0]
115118
use_skinny = (envs.VLLM_ROCM_USE_SKINNY_GEMM and on_gfx9() and \
116119
x.dtype in [torch.float16, torch.bfloat16] \

0 commit comments

Comments
 (0)