Skip to content

Commit

Permalink
Comments/fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
daniil-lyakhov committed Dec 5, 2024
1 parent 52e80c8 commit 9178921
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9178921

Please sign in to comment.