diff --git a/python/llm/src/ipex_llm/transformers/low_bit_linear.py b/python/llm/src/ipex_llm/transformers/low_bit_linear.py index 1dd9968402a..2712d82f879 100644 --- a/python/llm/src/ipex_llm/transformers/low_bit_linear.py +++ b/python/llm/src/ipex_llm/transformers/low_bit_linear.py @@ -699,7 +699,7 @@ def forward(self, x: torch.Tensor): if is_server() and (not is_spr()) and \ self.qtype == SYM_INT4 and x_2d.shape[0] >= TORCH_LINEAR_THRESHOLD: x0_fp32 = ggml_int4_convert_fp32(x0, self.weight_shape, self.weight_length) - result = F.linear(x, x0_fp32) + result = F.linear(x.to(dtype=x0_fp32.dtype), x0_fp32) else: # Weight does not need a convert result = ggml_matmul_src1_x_src0_t(x0, x_2d, self.weight_shape, self.qtype)