From 7e47c1d5d542580ade6d8a12b2d03cea7b3dfddb Mon Sep 17 00:00:00 2001 From: Sergey Shlyapnikov Date: Tue, 19 Dec 2023 11:02:56 +0400 Subject: [PATCH] [GPU] Apply MarkDequantizationSubgraph callback function only to compressed models --- .../intel_gpu/src/plugin/transformations_pipeline.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp index 18cc248cde836a..c73e16b4c662b8 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp +++ b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp @@ -201,7 +201,8 @@ void TransformationsPipeline::apply(std::shared_ptr func) { ov::disable_keep_const_precision(node); } - enableInt8 = config.get_property(ov::intel_gpu::enable_lp_transformations) && ov::pass::low_precision::LowPrecision::isFunctionQuantized(func); + auto is_model_quantized = ov::pass::low_precision::LowPrecision::isFunctionQuantized(func); + enableInt8 = config.get_property(ov::intel_gpu::enable_lp_transformations) && is_model_quantized; if (enableInt8) { manager.register_pass( std::vector{ ov::element::i8, ov::element::u8, ov::element::i4, ov::element::u4 }); @@ -280,8 +281,8 @@ void TransformationsPipeline::apply(std::shared_ptr func) { manager.register_pass(ov::element::TypeVector{ov::element::u8, ov::element::u4, ov::element::i4}, true); // Need to check if transfomrations work correctly for mixed models with both compression and quantization at the same time. - // Ignore nodes that are not related to FullyConnected and allow ConstantFolding to be applied to them - pass_config->set_callback(is_non_supported_decompression_op); + if (!is_model_quantized) + pass_config->set_callback(is_non_supported_decompression_op); manager.register_pass();