Skip to content

Commit 157ff77

Browse files
committed
bug fix ptpc invocation of aiter kernel and edge case of non aiter linear
Signed-off-by: tjtanaavllm <tunjian.tan@amd.com>
1 parent 3249595 commit 157ff77

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

vllm/model_executor/layers/quantization/utils/w8a8_utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ def rocm_aiter_gemm_a8w8_bpreshuffle_impl(
4242
# accept the weight as # keep the weight as (N, K)
4343
# NOTE: The weight has to be shuffled in the
4444
# process_weights_after_loading of the CompressedTensorsW8A8Fp8 class
45-
from aiter import gemm_a8w8_bpreshuffle_CK
46-
return gemm_a8w8_bpreshuffle_CK(input, weight, scale_a, scale_b,
47-
out_dtype)
45+
46+
m = input.shape[0]
47+
n = weight.shape[0]
48+
from aiter import gemm_a8w8_bpreshuffle_ck
49+
Y = torch.empty(m, n, dtype=out_dtype, device=input.device)
50+
gemm_a8w8_bpreshuffle_ck(input, weight, scale_a, scale_b, Y)
51+
return Y
4852

4953
def rocm_aiter_gemm_a8w8_bpreshuffle_fake(
5054
input: torch.Tensor,

vllm/model_executor/layers/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def inner_function(layer: torch.nn.Module,
101101

102102
if use_aiter:
103103
return aiter_ops.rocm_aiter_tuned_gemm(x, weight, bias)
104+
return torch.nn.functional.linear(x, weight, bias)
104105

105106
return inner_function
106107

0 commit comments

Comments
 (0)