Skip to content

Commit 40275cb

Browse files
authored
Fix bug with range step in ORTSmoothQuant._auto_tune_alpha() (#1439)
Signed-off-by: Pavel Kochnev <p.k_@bk.ru>
1 parent 3cb6d38 commit 40275cb

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

neural_compressor/adaptor/ox_utils/smooth_quant.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -500,15 +500,7 @@ def _auto_tune_alpha(self, calib_iter, alpha_min=0.3, alpha_max=0.7, alpha_step=
500500
logger.info("auto tuning alpha")
501501
import copy
502502

503-
alpha_scale = 100
504-
alpha_space = list(
505-
range(
506-
round(alpha_min * alpha_scale),
507-
round((alpha_max + alpha_step) * alpha_scale),
508-
round(alpha_step * alpha_scale),
509-
)
510-
)
511-
alpha_space = [alpha / alpha_scale for alpha in alpha_space]
503+
alpha_space = np.arange(alpha_min, alpha_max, alpha_step).tolist()
512504

513505
optimal_alphas = {}
514506
if self.model.is_large_model:

0 commit comments

Comments
 (0)