diff --git a/src/common/snippets/include/snippets/lowered/loop_manager.hpp b/src/common/snippets/include/snippets/lowered/loop_manager.hpp index c79e1c0c63c3ef..0aa327cc824089 100644 --- a/src/common/snippets/include/snippets/lowered/loop_manager.hpp +++ b/src/common/snippets/include/snippets/lowered/loop_manager.hpp @@ -74,8 +74,6 @@ class LinearIR::LoopManager { std::vector handlers; private: - void initialize_handlers(); - size_t m_work_amount = 0; size_t m_increment = 0; // The order of entry and exit expressions is important: diff --git a/src/common/snippets/include/snippets/lowered/pass/iter_handler.hpp b/src/common/snippets/include/snippets/lowered/pass/iter_handler.hpp index e98c9a4c111ef2..e5a852661b5b58 100644 --- a/src/common/snippets/include/snippets/lowered/pass/iter_handler.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/iter_handler.hpp @@ -17,7 +17,7 @@ namespace pass { class SetSingleIterationWithWorkAmount : public pass::SubgraphPass { public: SetSingleIterationWithWorkAmount(size_t work_amount); - OPENVINO_RTTI("SetSingleIterationWithWorkAmount", "Pass") + OPENVINO_RTTI("SetSingleIterationWithWorkAmount", "SubgraphPass") bool run(const LinearIR& linear_ir, LinearIR::constExprIt begin, LinearIR::constExprIt end) override; private: @@ -27,7 +27,7 @@ class SetSingleIterationWithWorkAmount : public pass::SubgraphPass { class UpdateMemoryAccessOps : public pass::SubgraphPass { public: UpdateMemoryAccessOps(size_t count); - OPENVINO_RTTI("UpdateMemoryAccessOps", "Pass") + OPENVINO_RTTI("UpdateMemoryAccessOps", "SubgraphPass") bool run(const LinearIR& linear_ir, LinearIR::constExprIt begin, LinearIR::constExprIt end) override; private: @@ -37,7 +37,7 @@ class UpdateMemoryAccessOps : public pass::SubgraphPass { class ReduceWorkAmount : public pass::SubgraphPass { public: ReduceWorkAmount(size_t reduce_value); - OPENVINO_RTTI("ReduceWorkAmount", "Pass") + OPENVINO_RTTI("ReduceWorkAmount", "SubgraphPass") bool run(const LinearIR& linear_ir, LinearIR::constExprIt begin, LinearIR::constExprIt end) override; private: @@ -46,14 +46,14 @@ class ReduceWorkAmount : public pass::SubgraphPass { class ZeroFinalizationOffsets : public pass::SubgraphPass { public: - OPENVINO_RTTI("ZeroFinalizationOffsets", "Pass") + OPENVINO_RTTI("ZeroFinalizationOffsets", "SubgraphPass") bool run(const LinearIR& linear_ir, LinearIR::constExprIt begin, LinearIR::constExprIt end) override; }; class SetFillOffset : public pass::SubgraphPass { public: SetFillOffset(size_t offset); - OPENVINO_RTTI("SetFillOffset", "Pass") + OPENVINO_RTTI("SetFillOffset", "SubgraphPass") bool run(const LinearIR& linear_ir, LinearIR::constExprIt begin, LinearIR::constExprIt end) override; private: @@ -63,7 +63,7 @@ class SetFillOffset : public pass::SubgraphPass { class TransformInnerSplitLoop : public pass::SubgraphPass { public: TransformInnerSplitLoop(size_t tail_size); - OPENVINO_RTTI("TransformInnerSplitLoop", "Pass") + OPENVINO_RTTI("TransformInnerSplitLoop", "SubgraphPass") bool run(const LinearIR& linear_ir, LinearIR::constExprIt begin, LinearIR::constExprIt end) override; private: diff --git a/src/common/snippets/src/lowered/loop_manager.cpp b/src/common/snippets/src/lowered/loop_manager.cpp index 383c81bd14a13b..88f74782620e88 100644 --- a/src/common/snippets/src/lowered/loop_manager.cpp +++ b/src/common/snippets/src/lowered/loop_manager.cpp @@ -49,7 +49,7 @@ LinearIR::LoopManager::LoopInfo::LoopInfo(size_t work_amount, m_entry_points(entries), m_exit_points(exits), m_outer_splited_loop(outer_splited_loop) { - initialize_handlers(); + handlers.resize(3); } LinearIR::LoopManager::LoopInfo::LoopInfo(size_t work_amount, @@ -66,7 +66,7 @@ LinearIR::LoopManager::LoopInfo::LoopInfo(size_t work_amount, m_entry_points.emplace_back(port); for (const auto& port : exits) m_exit_points.emplace_back(port); - initialize_handlers(); + handlers.resize(3); } std::shared_ptr LoopInfo::clone_with_new_expr(const ExressionMap& expr_map) const { @@ -150,10 +150,6 @@ void LoopInfo::set_outer_splited_loop(bool outer_splited_loop) { m_outer_splited_loop = outer_splited_loop; } -void LoopInfo::initialize_handlers() { - handlers.resize(3); -} - bool operator==(const LinearIR::LoopManager::LoopPort& lhs, const LinearIR::LoopManager::LoopPort& rhs) { if (&lhs == &rhs) return true; diff --git a/src/common/snippets/src/lowered/pass/fuse_loops.cpp b/src/common/snippets/src/lowered/pass/fuse_loops.cpp index b1d65d0c6945ad..dc7dac6eed4095 100644 --- a/src/common/snippets/src/lowered/pass/fuse_loops.cpp +++ b/src/common/snippets/src/lowered/pass/fuse_loops.cpp @@ -60,7 +60,7 @@ bool FuseLoops::can_be_fused(const LoopInfoPtr& loop_current, const LoopInfoPtr& // WA: we can't fuse 2 loops if one of them has first iteration handler but second hasn't, // because in this case Main/Tail body handlers of the loop wo first iter handler must be reset with new parameters - // (e.g. tail size). This logic is not implemented for now. + // (e.g. tail size). This logic is not implemented for now, so fusion for such loops is skipped. const bool first_iter_handlers_match = loop_current->handlers[LoopManager::LoopInfo::FIRST_ITER].empty() == loop_target->handlers[LoopManager::LoopInfo::FIRST_ITER].empty(); const bool equal_parameters = current_work_amount == target_work_amount && current_increment == target_increment; diff --git a/src/common/snippets/src/lowered/pass/insert_specific_iterations.cpp b/src/common/snippets/src/lowered/pass/insert_specific_iterations.cpp index d65d4943d968e0..4dd6cfa26745b4 100644 --- a/src/common/snippets/src/lowered/pass/insert_specific_iterations.cpp +++ b/src/common/snippets/src/lowered/pass/insert_specific_iterations.cpp @@ -73,10 +73,10 @@ bool InsertSpecificIterations::run(LinearIR& linear_ir) { if (!loop_end) continue; - std::vector pipelines_to_run; - for (const auto& handlers : loop_manager->get_loop_info(loop_end->get_id())->handlers) { - if (!handlers.empty()) - pipelines_to_run.emplace_back(handlers); + std::vector> pipelines_to_run; + for (const auto& pipeline : loop_manager->get_loop_info(loop_end->get_id())->handlers) { + if (!pipeline.empty()) + pipelines_to_run.emplace_back(pipeline); } if (pipelines_to_run.empty()) continue; @@ -90,10 +90,10 @@ bool InsertSpecificIterations::run(LinearIR& linear_ir) { }; for (size_t i = 0; i < pipelines_to_run.size() - 1; ++i) { - copy_and_run_specific_handlers(pipelines_to_run[i]); + copy_and_run_specific_handlers(pipelines_to_run[i].get()); } // Last pipeline is run on original body to avoid unnecesarry copy - pipelines_to_run.back().run(linear_ir, main_body_begin_it, main_body_end_it); + pipelines_to_run.back().get().run(linear_ir, main_body_begin_it, main_body_end_it); modified = true; } return modified; diff --git a/src/common/snippets/tests/src/lowered/pass/loop.cpp b/src/common/snippets/tests/src/lowered/pass/loop.cpp index f6f2bc0426409b..6d46fdebb30d1f 100644 --- a/src/common/snippets/tests/src/lowered/pass/loop.cpp +++ b/src/common/snippets/tests/src/lowered/pass/loop.cpp @@ -39,7 +39,7 @@ static void init_linear_ir(const std::vector& in_shapes, Linea const auto in_shape0 = in_shapes[0].get_shape(); const auto in_shape1 = in_shapes[1].get_shape(); const auto inner_wa = std::max(*in_shape0.rbegin(), *in_shape1.rbegin()); - const auto inner_inc = std::min(vector_size, inner_wa); + const auto inner_inc = vector_size; const auto blocked_wa = block_size; const auto blocked_inc = 1; const auto outer_wa = std::max(*(in_shape0.rbegin() + 1), *(in_shape1.rbegin() + 1)); diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/lowered/cpu_iter_handlers.hpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/lowered/cpu_iter_handlers.hpp index 97d98ce1be04ec..b60b958983ab66 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/lowered/cpu_iter_handlers.hpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/lowered/cpu_iter_handlers.hpp @@ -12,7 +12,7 @@ namespace pass { class SetBrgemmBeta : public snippets::lowered::pass::SubgraphPass { public: SetBrgemmBeta(float beta); - OPENVINO_RTTI("SetBrgemmBeta", "Pass") + OPENVINO_RTTI("SetBrgemmBeta", "SubgraphPass") bool run(const snippets::lowered::LinearIR& linear_ir, snippets::lowered::LinearIR::constExprIt begin, snippets::lowered::LinearIR::constExprIt end) override;