Skip to content

Commit 3cb6d38

Browse files
authored
Fix llm model accuracy regression with IPEX 2.1.100 (#1499)
Signed-off-by: Wang, Chang1 <chang1.wang@intel.com>
1 parent e827887 commit 3cb6d38

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

neural_compressor/adaptor/pytorch.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3365,7 +3365,6 @@ def qdq_quantize(self, model, q_model, tune_cfg, dataloader, q_func):
33653365
self._cfg_to_qconfig(tune_cfg, smooth_quant=True)
33663366
update_sq_scale(self.ipex_config_path, smoothquant_scale_info)
33673367
model._model.load_qconf_summary(qconf_summary=self.ipex_config_path)
3368-
33693368
# real calibration for other operators
33703369
try:
33713370
# IPEX may raise an error on the second iteration.
@@ -3383,8 +3382,10 @@ def qdq_quantize(self, model, q_model, tune_cfg, dataloader, q_func):
33833382
+ "using scale info from SmoothQuant for Linear and "
33843383
+ "one iter calibration for other ops."
33853384
)
3386-
33873385
model._model.save_qconf_summary(qconf_summary=self.ipex_config_path)
3386+
if self.version.release > Version("2.1.0").release:
3387+
update_sq_scale(self.ipex_config_path, smoothquant_scale_info)
3388+
model._model.load_qconf_summary(qconf_summary=self.ipex_config_path)
33883389
self._ipex_post_quant_process(model, q_model, dataloader, inplace=inplace)
33893390

33903391
with open(self.ipex_config_path, "r") as f:

0 commit comments

Comments
 (0)