diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/convert_to_cpu_specific_opset.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/convert_to_cpu_specific_opset.hpp index e334d11babe0ee..4139d5c6cf8042 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/convert_to_cpu_specific_opset.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/convert_to_cpu_specific_opset.hpp @@ -15,11 +15,9 @@ #include "common/pass/convert_to_swish_cpu.hpp" #include "common/pass/move_fc_reshape_to_weights.hpp" #include "transformations/convert_precision.hpp" -#include "transformations/symbolic_transformations/symbolic_optimizations.hpp" #include "transformations/utils/utils.hpp" #include "common/pass/rnn_sequences_optimization.hpp" #include "transformations/common_optimizations/reshape_sequence_fusion.hpp" -#include "common/pass/ngram_fusion.hpp" #include "transformations/defs.hpp" #include "itt.hpp" @@ -50,8 +48,6 @@ inline void ConvertToCPUSpecificOpset(std::shared_ptr &nGraphFunc) { type_to_fuse_map{{}}, false, false); - auto symbolic_pipeline = CPU_REGISTER_PASS_COMMON(manager, ov::pass::SymbolicOptimizations, false); - symbolic_pipeline->get_manager()->register_pass(); CPU_REGISTER_PASS_COMMON(manager, ov::pass::Validate); manager.run_passes(nGraphFunc); diff --git a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp index a4522436fbbaaf..817f346d670c5f 100644 --- a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp +++ b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp @@ -83,6 +83,7 @@ #include "transformations/opset_conversions/convert_opset2_to_opset1.hpp" #include "transformations/opset_conversions/convert_opset3_to_opset2.hpp" #include "transformations/smart_reshape/matmul_sr.hpp" +#include "transformations/symbolic_transformations/symbolic_optimizations.hpp" #include "transformations/init_node_info.hpp" #include "utils/ngraph_transformation.hpp" #include "utils/print_model.hpp" @@ -113,6 +114,7 @@ #include "transformations/cpu_opset/common/pass/convert_fq_rnn_to_quantized_rnn.hpp" #include "transformations/cpu_opset/common/pass/insert_convert_after_extension.hpp" #include "transformations/cpu_opset/common/pass/move_eltwise_up_data_movement.hpp" +#include "transformations/cpu_opset/common/pass/ngram_fusion.hpp" #include "transformations/cpu_opset/common/pass/permute_slice_n_interpolation.hpp" #include "transformations/cpu_opset/common/pass/swap_convert_transpose.hpp" #include "transformations/cpu_opset/common/pass/rope_fusion.hpp" @@ -708,6 +710,11 @@ void Transformations::PostLpt() { CPU_REGISTER_PASS_X64(postLPTPassManager, RoPEFusion); CPU_REGISTER_PASS_X64(postLPTPassManager, StatefulSDPAFusion); + + // Should be before Snippets pipeline because Ngram pattern contains eltwise nodes that can be tokenized by Snippets. + auto symbolic_pipeline = CPU_REGISTER_PASS_COMMON(postLPTPassManager, ov::pass::SymbolicOptimizations, false); + symbolic_pipeline->get_manager()->register_pass(); + postLPTPassManager.run_passes(model); }