Skip to content

Commit

Permalink
fix ac import ptq_hpo (PaddlePaddle#1170)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceci3 authored Jun 14, 2022
1 parent 1b498f1 commit 3ae057a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions paddleslim/auto_compression/compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

try:
if platform.system().lower() == 'linux':
from ..quant import quant_post_hpo
from ..quant import post_quant_hpo
except Exception as e:
_logger.warning(e)

Expand Down Expand Up @@ -409,7 +409,7 @@ def compress(self):

if strategy == 'ptq_hpo' and config.max_quant_count == 1 and platform.system(
).lower() == 'linux':
ptq_loss = quant_post_hpo.g_min_emd_loss
ptq_loss = post_quant_hpo.g_min_emd_loss

final_quant_config = get_final_quant_config(ptq_loss)
if final_quant_config is not None:
Expand Down Expand Up @@ -468,7 +468,7 @@ def single_strategy_compress(self, strategy, config, strategy_idx):
raise NotImplementedError(
"post-quant-hpo is not support in system other than linux")

quant_post_hpo.quant_post_hpo(
post_quant_hpo.quant_post_hpo(
self._exe,
self._places,
model_dir=self.model_dir,
Expand Down
2 changes: 1 addition & 1 deletion paddleslim/quant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from .quanter import quant_post, quant_post_only_weight
from .quant_aware_with_infermodel import quant_aware_with_infermodel, export_quant_infermodel
if platform.system().lower() == 'linux':
from .quant_post_hpo import quant_post_hpo
from .post_quant_hpo import quant_post_hpo
else:
_logger.warning(
"post-quant-hpo is not support in system other than linux")
Expand Down
File renamed without changes.

0 comments on commit 3ae057a

Please sign in to comment.