From ba87e351b5406abb3e22b60f354a509d233f1db3 Mon Sep 17 00:00:00 2001 From: Jedrzej Hajduczenia Date: Sat, 11 Jan 2025 01:28:15 +0000 Subject: [PATCH] Enable GroupNormalization fusion pass in GPU plugin --- .../intel_gpu/src/plugin/transformations_pipeline.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp index 662323813aa27f..7affacee280702 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp +++ b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp @@ -89,6 +89,7 @@ #include "transformations/common_optimizations/broadcast_transition.hpp" #include "transformations/common_optimizations/common_optimizations.hpp" #include "transformations/common_optimizations/convert_quantize_dequantize.hpp" +#include "transformations/common_optimizations/group_normalization_fusion.hpp" #include "transformations/common_optimizations/lin_op_sequence_fusion.hpp" #include "transformations/common_optimizations/lstm_cell_fusion.hpp" #include "transformations/common_optimizations/move_eltwise_up_data_movement.hpp" @@ -290,6 +291,13 @@ void TransformationsPipeline::apply(std::shared_ptr func) { auto pass_config = manager.get_pass_config(); manager.set_per_pass_validation(false); + // fuse following ops into GroupNormalization: + // group_norm_gamma * (instance_norm_gamma * MVN(x) + instance_norm_beta) + group_norm_beta + // note that instance norm related parameters are optional: + // - instance_norm_gamma is assumed to be filled with ones if not present in the graph + // - instance_norm_beta is assumed to be filled with zeros if not present in the graph + manager.register_pass(); + // Temporary solution, global rt info cleanup is needed for (auto& node : func->get_ops()) { ov::enable_constant_folding(node);