Skip to content

Commit 85a01b0

Browse files
committed
Fix UT
1 parent dd15734 commit 85a01b0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bitsandbytes/backends/cpu_xpu_common.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,11 @@ def dequantize_4bit_impl(
440440
if quant_state.nested:
441441
raise NotImplementedError("bnb_4bit_use_double_quant is not supported yet for CPU/XPU")
442442

443+
if ipex_cpu and _ipex_cpu_version_prereq(2, 3) and hasattr(quant_state, "op_context"):
444+
assert quant_state.op_context is not None
445+
A = quant_state.op_context.to_public(quant_state.op_context.get_weight())
446+
A = A.reshape(-1)
447+
443448
if out is None:
444449
out = torch.empty(quant_state.shape, dtype=quant_state.dtype, device=A.device)
445450

@@ -503,7 +508,7 @@ def gemm_4bit_impl(
503508
torch.Tensor:
504509
GEMM output tensor.
505510
"""
506-
if ipex_cpu and _ipex_cpu_version_prereq(2, 2) and hasattr(state, "op_context"):
511+
if ipex_cpu and _ipex_cpu_version_prereq(2, 3) and hasattr(state, "op_context"):
507512
assert state.op_context is not None
508513
output = torch.ops.torch_ipex.ipex_woq_linear(A, state.op_context.get_data_handle())
509514
else:

0 commit comments

Comments
 (0)