Skip to content

Commit 2d56b82

Browse files
[CPU] Fix test/cpu/test_ipex_llm_quantization.py and test_ipex_optimize_transformers.py (#5016)
* fix test_ipex_llm_quantization.py * fix test_ipex_optimize_transformers.py * change int4 parameter order in test
1 parent 32b0bad commit 2d56b82

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

intel_extension_for_pytorch/llm/quantization/woq_linear.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def from_weight(
7171
bias,
7272
group_size,
7373
g_idx,
74-
quant_method,
7574
dtype,
75+
quant_method,
7676
**kwargs,
7777
)
7878
return cls(woq_linear_impl)

intel_extension_for_pytorch/transformers/generation/sample.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,6 @@ def _sample(
9090
logits_warper = (
9191
logits_warper if logits_warper is not None else LogitsProcessorList()
9292
)
93-
pad_token_id = (
94-
pad_token_id
95-
if pad_token_id is not None
96-
else self.generation_config.pad_token_id
97-
)
98-
eos_token_id = (
99-
eos_token_id
100-
if eos_token_id is not None
101-
else self.generation_config.eos_token_id
102-
)
10393
if isinstance(eos_token_id, int):
10494
eos_token_id = [eos_token_id]
10595
eos_token_id_tensor = (

tests/gpu/examples/test_int4_linear.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ def test_awq_woqlinear_interface(
386386
None,
387387
group_size,
388388
g_idx4kernel,
389-
ipex.llm.quantization.QuantMethod.AWQ_GEMM,
390389
ipex.llm.quantization.QuantDtype.INT4,
390+
ipex.llm.quantization.QuantMethod.AWQ_GEMM,
391391
)
392392
out_xetla = woqlinear(input)
393393
out_torch = torch.matmul(input_torch, weight_fp16)

0 commit comments

Comments
 (0)