diff --git a/nncf/experimental/common/quantization/algorithms/post_training/algorithm.py b/nncf/experimental/common/quantization/algorithms/post_training/algorithm.py index efbc5bb7449..ac2d86a3056 100644 --- a/nncf/experimental/common/quantization/algorithms/post_training/algorithm.py +++ b/nncf/experimental/common/quantization/algorithms/post_training/algorithm.py @@ -47,7 +47,7 @@ def __init__( weights_range_estimator_params: Optional[RangeEstimatorParameters] = None, ): """ - :param quantizer: NNCFQuantizer to use in MiMaxRageInit algorithm. + :param quantizer: NNCFQuantizer to use in MiMaxRangeInit algorithm. :param subset_size: Size of a subset to calculate activations statistics used for quantization. :param fast_bias_correction: Setting this option to `False` enables a different diff --git a/nncf/experimental/common/quantization/algorithms/post_training/pipeline.py b/nncf/experimental/common/quantization/algorithms/post_training/pipeline.py index dab7b2be856..5c8e521f65a 100644 --- a/nncf/experimental/common/quantization/algorithms/post_training/pipeline.py +++ b/nncf/experimental/common/quantization/algorithms/post_training/pipeline.py @@ -44,7 +44,7 @@ def experimental_create_ptq_pipeline( 2) MinMaxRangeInit 3) FastBiasCorrection or BiasCorrection - :param quantizer: NNCFQuantizer to use in MiMaxRageInit algorithm. + :param quantizer: NNCFQuantizer to use in MiMaxRangeInit algorithm. :param subset_size: Size of a subset to calculate activations statistics used for quantization. :param fast_bias_correction: Setting this option to `False` enables a different @@ -66,7 +66,7 @@ def experimental_create_ptq_pipeline( if smooth_quant_params is None: smooth_quant_params = AdvancedSmoothQuantParameters() - if smooth_quant and smooth_quant_params.convolution >= 0 or smooth_quant_params.matmul >= 0: + if smooth_quant and (smooth_quant_params.convolution >= 0 or smooth_quant_params.matmul >= 0): alpha_map = {"convolution": smooth_quant_params.convolution, "matmul": smooth_quant_params.matmul} pipeline_steps.append([SmoothQuant(subset_size, False, alpha_map=alpha_map)]) diff --git a/nncf/experimental/common/quantization/algorithms/quantizer/fx_quantizer.py b/nncf/experimental/common/quantization/algorithms/quantizer/fx_quantizer.py index db0ae167132..33e0ef94a79 100644 --- a/nncf/experimental/common/quantization/algorithms/quantizer/fx_quantizer.py +++ b/nncf/experimental/common/quantization/algorithms/quantizer/fx_quantizer.py @@ -41,7 +41,8 @@ def __init__(self, quantizer: Quantizer): def get_quantization_setup(self, model: torch.fx.GraphModule, nncf_graph: NNCFGraph) -> SingleConfigQuantizerSetup: anotated_model = deepcopy(model) - self._quantizer.transform_for_annotation(anotated_model) + # self._quantizer.transform_for_annotation is called in the nncf quantize_pt2e method + # before the nncf_graph building. self._quantizer.annotate(anotated_model) self._quantizer.validate(anotated_model) return self.get_quantizer_config_from_anotated_model(anotated_model)