Skip to content

Commit

Permalink
[PTQ] Added warning logger for pot backend (#1984)
Browse files Browse the repository at this point in the history
### Changes

- Added warning message for POT backend

### Reason for changes

- Better UX
  • Loading branch information
KodiaqQ authored Jul 24, 2023
1 parent 59f64bb commit d6e7dcc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nncf/openvino/pot/quantization/quantize_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ def quantize_impl(
if advanced_parameters is None:
advanced_parameters = AdvancedQuantizationParameters()

if model_type == ModelType.TRANSFORMER and advanced_parameters.smooth_quant_alpha > 0:
nncf_logger.warning(
'IMPORTANT. The advanced parameter "smooth_quant_alpha > 0" IS NOT SUPPORTED for the POT backend!'
'Please, use "smooth_quant_alpha = -1".'
)

algorithm_parameters = _create_quantization_config(
preset, target_device, subset_size, fast_bias_correction, model_type, ignored_scope, advanced_parameters
)
Expand Down Expand Up @@ -434,6 +440,12 @@ def quantize_with_accuracy_control_impl(
if advanced_quantization_parameters is None:
advanced_quantization_parameters = AdvancedQuantizationParameters()

if model_type == ModelType.TRANSFORMER and advanced_quantization_parameters.smooth_quant_alpha > 0:
nncf_logger.warning(
'IMPORTANT. The advanced parameter "smooth_quant_alpha > 0" IS NOT SUPPORTED for the POT backend!'
'Please, use "smooth_quant_alpha = -1".'
)

if advanced_quantization_parameters.disable_bias_correction:
raise ValueError(
"Quantization algorithm with accuracy controll from the OpenVINO backend "
Expand Down

0 comments on commit d6e7dcc

Please sign in to comment.