Refactor 2 awq gemm kernels into m16nXk32 (#2723)

Co-authored-by: Chunan Zeng <chunanzeng@Chunans-Air.attlocal.net>
This commit is contained in:
Rex
2024-02-12 11:02:17 -08:00
committed by GitHub
co-authored by Chunan Zeng
parent 4ca2c358b1
commit 563836496a
2 changed files with 75 additions and 297 deletions
@@ -145,8 +145,8 @@ class AWQLinearMethod(LinearMethodBase):
x: torch.Tensor,
bias: Optional[torch.Tensor] = None) -> torch.Tensor:
qweight = weights["qweight"]
qzeros = weights["qzeros"]
scales = weights["scales"]
qzeros = weights["qzeros"]
pack_factor = self.quant_config.pack_factor
out_shape = (x.shape[:-1] + (qweight.shape[-1] * pack_factor, ))
reshaped_x = x.reshape(-1, x.shape[-1])