From d6e7dcc1868ac4427e6df92cfda91b7b4ad5ab94 Mon Sep 17 00:00:00 2001 From: Nikita Malinin Date: Mon, 24 Jul 2023 10:00:21 +0200 Subject: [PATCH] [PTQ] Added warning logger for pot backend (#1984) ### Changes - Added warning message for POT backend ### Reason for changes - Better UX --- nncf/openvino/pot/quantization/quantize_model.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/nncf/openvino/pot/quantization/quantize_model.py b/nncf/openvino/pot/quantization/quantize_model.py index d1dd0e602d0..5bb985bff9e 100644 --- a/nncf/openvino/pot/quantization/quantize_model.py +++ b/nncf/openvino/pot/quantization/quantize_model.py @@ -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 ) @@ -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 "