From 9e45f707d464fe0ad041e777f2c4436aaca18427 Mon Sep 17 00:00:00 2001 From: Alexandra Sidorova Date: Mon, 17 Apr 2023 17:08:27 +0400 Subject: [PATCH] [Snippets] Refactoring of transformations --- ...er_allocation.hpp => allocate_buffers.hpp} | 6 ++-- .../pass/{loop_fusion.hpp => fuse_loops.hpp} | 8 ++--- ...entification.hpp => indentify_buffers.hpp} | 8 ++--- .../pass/{loop_init.hpp => init_loops.hpp} | 6 ++-- ...uffer_insertion.hpp => insert_buffers.hpp} | 10 +++--- ...re_insertion.hpp => insert_load_store.hpp} | 10 +++--- .../pass/{loop_markup.hpp => mark_loops.hpp} | 8 ++--- .../{buffer_reset.hpp => reset_buffers.hpp} | 8 ++--- src/common/snippets/src/generator.cpp | 36 +++++++++---------- ...er_allocation.cpp => allocate_buffers.cpp} | 8 ++--- .../pass/{loop_fusion.cpp => fuse_loops.cpp} | 16 ++++----- ...entification.cpp => indentify_buffers.cpp} | 10 +++--- .../pass/{loop_init.cpp => init_loops.cpp} | 16 ++++----- ...uffer_insertion.cpp => insert_buffers.cpp} | 12 +++---- ...re_insertion.cpp => insert_load_store.cpp} | 16 ++++----- .../pass/{loop_markup.cpp => mark_loops.cpp} | 8 ++--- .../{buffer_reset.cpp => reset_buffers.cpp} | 8 ++--- .../lowered/pass/softmax_decomposition.cpp | 2 +- 18 files changed, 98 insertions(+), 98 deletions(-) rename src/common/snippets/include/snippets/lowered/pass/{buffer_allocation.hpp => allocate_buffers.hpp} (85%) rename src/common/snippets/include/snippets/lowered/pass/{loop_fusion.hpp => fuse_loops.hpp} (93%) rename src/common/snippets/include/snippets/lowered/pass/{buffer_identification.hpp => indentify_buffers.hpp} (89%) rename src/common/snippets/include/snippets/lowered/pass/{loop_init.hpp => init_loops.hpp} (94%) rename src/common/snippets/include/snippets/lowered/pass/{buffer_insertion.hpp => insert_buffers.hpp} (84%) rename src/common/snippets/include/snippets/lowered/pass/{load_store_insertion.hpp => insert_load_store.hpp} (81%) rename src/common/snippets/include/snippets/lowered/pass/{loop_markup.hpp => mark_loops.hpp} (82%) rename src/common/snippets/include/snippets/lowered/pass/{buffer_reset.hpp => reset_buffers.hpp} (87%) rename src/common/snippets/src/lowered/pass/{buffer_allocation.cpp => allocate_buffers.cpp} (94%) rename src/common/snippets/src/lowered/pass/{loop_fusion.cpp => fuse_loops.cpp} (96%) rename src/common/snippets/src/lowered/pass/{buffer_identification.cpp => indentify_buffers.cpp} (95%) rename src/common/snippets/src/lowered/pass/{loop_init.cpp => init_loops.cpp} (94%) rename src/common/snippets/src/lowered/pass/{buffer_insertion.cpp => insert_buffers.cpp} (96%) rename src/common/snippets/src/lowered/pass/{load_store_insertion.cpp => insert_load_store.cpp} (91%) rename src/common/snippets/src/lowered/pass/{loop_markup.cpp => mark_loops.cpp} (94%) rename src/common/snippets/src/lowered/pass/{buffer_reset.cpp => reset_buffers.cpp} (93%) diff --git a/src/common/snippets/include/snippets/lowered/pass/buffer_allocation.hpp b/src/common/snippets/include/snippets/lowered/pass/allocate_buffers.hpp similarity index 85% rename from src/common/snippets/include/snippets/lowered/pass/buffer_allocation.hpp rename to src/common/snippets/include/snippets/lowered/pass/allocate_buffers.hpp index cf944745d5a63d..d1ad2fb2d5296f 100644 --- a/src/common/snippets/include/snippets/lowered/pass/buffer_allocation.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/allocate_buffers.hpp @@ -13,14 +13,14 @@ namespace lowered { namespace pass { /** - * @interface BufferAllocation + * @interface AllocateBuffers * @brief The pass calculation common size of buffer scratchpad and propagates Buffer offsets to connected MemoryAccess operations. * @ingroup snippets */ -class BufferAllocation : public Transformation { +class AllocateBuffers : public Transformation { public: - OPENVINO_RTTI("BufferAllocation", "Transformation") + OPENVINO_RTTI("AllocateBuffers", "Transformation") bool run(lowered::LinearIR& linear_ir) override; size_t get_scratchpad_size() const { return m_buffer_scratchpad_size; } diff --git a/src/common/snippets/include/snippets/lowered/pass/loop_fusion.hpp b/src/common/snippets/include/snippets/lowered/pass/fuse_loops.hpp similarity index 93% rename from src/common/snippets/include/snippets/lowered/pass/loop_fusion.hpp rename to src/common/snippets/include/snippets/lowered/pass/fuse_loops.hpp index aab90e3232d563..1f355fbe9dfbb6 100644 --- a/src/common/snippets/include/snippets/lowered/pass/loop_fusion.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/fuse_loops.hpp @@ -14,14 +14,14 @@ namespace lowered { namespace pass { /** - * @interface LoopFusion + * @interface FuseLoops * @brief The pass fuses marking Loops. * @ingroup snippets */ -class LoopFusion : public Transformation { +class FuseLoops : public Transformation { public: - OPENVINO_RTTI("LoopFusion", "Transformation") - LoopFusion(); + OPENVINO_RTTI("FuseLoops", "Transformation") + FuseLoops(); bool run(LinearIR& linear_ir) override; private: diff --git a/src/common/snippets/include/snippets/lowered/pass/buffer_identification.hpp b/src/common/snippets/include/snippets/lowered/pass/indentify_buffers.hpp similarity index 89% rename from src/common/snippets/include/snippets/lowered/pass/buffer_identification.hpp rename to src/common/snippets/include/snippets/lowered/pass/indentify_buffers.hpp index d108e75d869760..ca3483f02b41b4 100644 --- a/src/common/snippets/include/snippets/lowered/pass/buffer_identification.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/indentify_buffers.hpp @@ -12,7 +12,7 @@ namespace lowered { namespace pass { /** - * @interface BufferIdentification + * @interface IdentifyBuffers * @brief The pass set identifiers for Buffers in common Buffer system. * The buffers with the same identifier has the same data register. * The pass uses greedy graph coloring algorithm using adjacency matrix: @@ -26,10 +26,10 @@ namespace pass { * Note: should be called before ResetBuffer() pass to have correct offsets * @ingroup snippets */ -class BufferIdentification: public Transformation { +class IdentifyBuffers: public Transformation { public: - OPENVINO_RTTI("BufferIdentification", "Transformation") - BufferIdentification() = default; + OPENVINO_RTTI("IdentifyBuffers", "Transformation") + IdentifyBuffers() = default; bool run(LinearIR& linear_ir) override; diff --git a/src/common/snippets/include/snippets/lowered/pass/loop_init.hpp b/src/common/snippets/include/snippets/lowered/pass/init_loops.hpp similarity index 94% rename from src/common/snippets/include/snippets/lowered/pass/loop_init.hpp rename to src/common/snippets/include/snippets/lowered/pass/init_loops.hpp index cb769196e65b73..064c5200170e52 100644 --- a/src/common/snippets/include/snippets/lowered/pass/loop_init.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/init_loops.hpp @@ -14,14 +14,14 @@ namespace lowered { namespace pass { /** - * @interface LoopInit + * @interface InitLoops * @brief The pass explicitly insert LoadBegin and LoadEnd in Linear IR using Loop markup * @ingroup snippets */ -class LoopInit : public Transformation { +class InitLoops : public Transformation { public: OPENVINO_RTTI("InsertLoops", "Transformation") - LoopInit(); + InitLoops(); bool run(LinearIR& linear_ir) override; private: diff --git a/src/common/snippets/include/snippets/lowered/pass/buffer_insertion.hpp b/src/common/snippets/include/snippets/lowered/pass/insert_buffers.hpp similarity index 84% rename from src/common/snippets/include/snippets/lowered/pass/buffer_insertion.hpp rename to src/common/snippets/include/snippets/lowered/pass/insert_buffers.hpp index 3835502a70c155..552ca10ab94863 100644 --- a/src/common/snippets/include/snippets/lowered/pass/buffer_insertion.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/insert_buffers.hpp @@ -13,17 +13,17 @@ namespace lowered { namespace pass { /** - * @interface BufferInsertion + * @interface InsertBuffers * @brief The pass inserts Buffer between exit points of one loop (or Brgemm) and * entry points of another loop (or Brgemm) to store intermediate data. - * The pass should be called after LoopFusion. + * The pass should be called after FuseLoops. * @param m_buffer_allocation_rank - rank of shape for memory allocation: shape[shape_rank - normalize(m_allocation_rank) : shape_rank] * @ingroup snippets */ -class BufferInsertion : public Transformation { +class InsertBuffers : public Transformation { public: - OPENVINO_RTTI("BufferInsertion", "Transformation") - BufferInsertion(int32_t buffer_allocation_rank); + OPENVINO_RTTI("InsertBuffers", "Transformation") + InsertBuffers(int32_t buffer_allocation_rank); bool run(LinearIR& linear_ir) override; private: diff --git a/src/common/snippets/include/snippets/lowered/pass/load_store_insertion.hpp b/src/common/snippets/include/snippets/lowered/pass/insert_load_store.hpp similarity index 81% rename from src/common/snippets/include/snippets/lowered/pass/load_store_insertion.hpp rename to src/common/snippets/include/snippets/lowered/pass/insert_load_store.hpp index c4fdcfc55ae412..bbc29656084324 100644 --- a/src/common/snippets/include/snippets/lowered/pass/load_store_insertion.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/insert_load_store.hpp @@ -14,16 +14,16 @@ namespace lowered { namespace pass { /** - * @interface LoadStoreInsertion + * @interface InsertLoadStore * @brief The pass inserts Load and Store expressions in Linear IR after Parameters, Buffers and before Results, Buffers accordingly. - * Note: The pass should be called after LoopFusion and BufferInsertion passes to have all possible data expressions. + * Note: The pass should be called after FuseLoops and InsertBuffers passes to have all possible data expressions. * @param m_vector_size - the count of elements for loading/storing * @ingroup snippets */ -class LoadStoreInsertion : public Transformation { +class InsertLoadStore : public Transformation { public: - explicit LoadStoreInsertion(size_t vector_size); - OPENVINO_RTTI("LoadStoreInsertion", "Transformation") + explicit InsertLoadStore(size_t vector_size); + OPENVINO_RTTI("InsertLoadStore", "Transformation") bool run(LinearIR& linear_ir) override; private: diff --git a/src/common/snippets/include/snippets/lowered/pass/loop_markup.hpp b/src/common/snippets/include/snippets/lowered/pass/mark_loops.hpp similarity index 82% rename from src/common/snippets/include/snippets/lowered/pass/loop_markup.hpp rename to src/common/snippets/include/snippets/lowered/pass/mark_loops.hpp index a81bb6c1194e94..4f454013f14ecb 100644 --- a/src/common/snippets/include/snippets/lowered/pass/loop_markup.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/mark_loops.hpp @@ -13,17 +13,17 @@ namespace lowered { namespace pass { /** - * @interface LoopMarkup + * @interface MarkLoops * @brief The pass marks expressions with Loop IDs. * The pass iterates expression by expression till the following conditions: * - the layouts and subtensors them are the same * - the consumer of the expression is explicitly after this expression - the pass marks the branches * @ingroup snippets */ -class LoopMarkup : public Transformation { +class MarkLoops : public Transformation { public: - OPENVINO_RTTI("LoopMarkup", "Transformation") - LoopMarkup(size_t vector_size); + OPENVINO_RTTI("MarkLoops", "Transformation") + MarkLoops(size_t vector_size); bool run(LinearIR& linear_ir) override; private: diff --git a/src/common/snippets/include/snippets/lowered/pass/buffer_reset.hpp b/src/common/snippets/include/snippets/lowered/pass/reset_buffers.hpp similarity index 87% rename from src/common/snippets/include/snippets/lowered/pass/buffer_reset.hpp rename to src/common/snippets/include/snippets/lowered/pass/reset_buffers.hpp index 0cfcb78bf9dad9..c16c0b589ddfcc 100644 --- a/src/common/snippets/include/snippets/lowered/pass/buffer_reset.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/reset_buffers.hpp @@ -12,7 +12,7 @@ namespace lowered { namespace pass { /** - * @interface BufferReset + * @interface ResetBuffers * @brief The pass `fuses` (reset) ptr increments and finalization offsets for ports of Loop * with the same Buffers (with the same ID) to avoid double ptr shifts * Note: Buffer always employ inplace logics by default. It means that if a loop has both @@ -21,10 +21,10 @@ namespace pass { * This condition should be removed when Buffers stop being inplace by default. * @ingroup snippets */ -class BufferReset: public Transformation { +class ResetBuffers: public Transformation { public: - OPENVINO_RTTI("BufferReset", "Transformation") - BufferReset() = default; + OPENVINO_RTTI("ResetBuffers", "Transformation") + ResetBuffers() = default; bool run(LinearIR& linear_ir) override; diff --git a/src/common/snippets/src/generator.cpp b/src/common/snippets/src/generator.cpp index 0e72ad86a2e31c..c82d8c69b285ce 100644 --- a/src/common/snippets/src/generator.cpp +++ b/src/common/snippets/src/generator.cpp @@ -7,21 +7,21 @@ #include "snippets/lowered/linear_ir.hpp" #include "snippets/lowered/pass/assign_registers.hpp" #include "snippets/lowered/pass/insert_tail_loop.hpp" -#include "snippets/lowered/pass/loop_markup.hpp" -#include "snippets/lowered/pass/loop_fusion.hpp" -#include "snippets/lowered/pass/loop_init.hpp" -#include "snippets/lowered/pass/buffer_insertion.hpp" -#include "snippets/lowered/pass/load_store_insertion.hpp" +#include "snippets/lowered/pass/mark_loops.hpp" +#include "snippets/lowered/pass/fuse_loops.hpp" +#include "snippets/lowered/pass/init_loops.hpp" +#include "snippets/lowered/pass/insert_buffers.hpp" +#include "snippets/lowered/pass/insert_load_store.hpp" #include "snippets/lowered/pass/vector_to_scalar.hpp" #include "snippets/lowered/pass/load_movebroadcast_to_broadcastload.hpp" -#include "snippets/lowered/pass/buffer_allocation.hpp" +#include "snippets/lowered/pass/allocate_buffers.hpp" #include "snippets/lowered/pass/propagate_layout.hpp" #include "snippets/lowered/pass/cleanup_loop_offsets.hpp" #include "snippets/lowered/pass/softmax_decomposition.hpp" #include "snippets/lowered/pass/move_scalar_to_consumer.hpp" #include "snippets/lowered/pass/move_result_out_of_loop.hpp" -#include "snippets/lowered/pass/buffer_reset.hpp" -#include "snippets/lowered/pass/buffer_identification.hpp" +#include "snippets/lowered/pass/reset_buffers.hpp" +#include "snippets/lowered/pass/indentify_buffers.hpp" #include "snippets/op/kernel.hpp" #include "snippets/tensor_descriptor.hpp" @@ -41,18 +41,18 @@ Generator::LoweringResult Generator::generate(std::shared_ptr& m, con const size_t vector_size = get_target_machine()->get_lanes(); const int32_t buffer_allocation_rank = static_cast(config.m_loop_depth); - // Note: The pass LoopInit uses LoopInfo that contains entry and exit points of the corresponding Loop. + // Note: The pass InitLoops uses LoopInfo that contains entry and exit points of the corresponding Loop. // To avoid the Loop information corruption, we should call the passes with Load/Store work - // (for example, LoadMoveBroadcastToBroadcastLoad()) after explicit Loop insertion (LoopInit()) + // (for example, LoadMoveBroadcastToBroadcastLoad()) after explicit Loop insertion (InitLoops()) lowered::pass::TransformationPipeline common_pipeline; - common_pipeline.register_transformation(vector_size); + common_pipeline.register_transformation(vector_size); common_pipeline.register_transformation(vector_size); - common_pipeline.register_transformation(); + common_pipeline.register_transformation(); common_pipeline.register_transformation(); - common_pipeline.register_transformation(buffer_allocation_rank); - common_pipeline.register_transformation(vector_size); + common_pipeline.register_transformation(buffer_allocation_rank); + common_pipeline.register_transformation(vector_size); common_pipeline.register_transformation(); - common_pipeline.register_transformation(); + common_pipeline.register_transformation(); common_pipeline.register_transformation(); common_pipeline.register_transformation(); common_pipeline.register_transformation(); // or should be in final? @@ -65,10 +65,10 @@ Generator::LoweringResult Generator::generate(std::shared_ptr& m, con return get_op_reg_type(op); }; - const auto buffer_allocation_pass = std::make_shared(); + const auto buffer_allocation_pass = std::make_shared(); lowered::pass::TransformationPipeline buffer_pipeline; - buffer_pipeline.register_transformation(); - buffer_pipeline.register_transformation(); + buffer_pipeline.register_transformation(); + buffer_pipeline.register_transformation(); buffer_pipeline.register_transformation(buffer_allocation_pass); buffer_pipeline.run(linear_ir); diff --git a/src/common/snippets/src/lowered/pass/buffer_allocation.cpp b/src/common/snippets/src/lowered/pass/allocate_buffers.cpp similarity index 94% rename from src/common/snippets/src/lowered/pass/buffer_allocation.cpp rename to src/common/snippets/src/lowered/pass/allocate_buffers.cpp index 25f47c8b0b5600..79f5d79fad09ab 100644 --- a/src/common/snippets/src/lowered/pass/buffer_allocation.cpp +++ b/src/common/snippets/src/lowered/pass/allocate_buffers.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/lowered/pass/buffer_allocation.hpp" +#include "snippets/lowered/pass/allocate_buffers.hpp" #include "snippets/lowered/linear_ir.hpp" #include "snippets/itt.hpp" @@ -12,7 +12,7 @@ namespace snippets { namespace lowered { namespace pass { -void BufferAllocation::propagate_offset(const LinearIR& linear_ir, const ExpressionPtr& buffer_expr, const size_t offset) { +void AllocateBuffers::propagate_offset(const LinearIR& linear_ir, const ExpressionPtr& buffer_expr, const size_t offset) { // If Buffer has offset We set this offset in the connected MemoryAccess ops // to correctly read and write data because all Buffers has the common data pointer on buffer scratchpad @@ -55,8 +55,8 @@ void BufferAllocation::propagate_offset(const LinearIR& linear_ir, const Express } -bool BufferAllocation::run(LinearIR& linear_ir) { - OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::BufferAllocation"); +bool AllocateBuffers::run(LinearIR& linear_ir) { + OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::AllocateBuffers"); bool modified = false; size_t offset = 0; diff --git a/src/common/snippets/src/lowered/pass/loop_fusion.cpp b/src/common/snippets/src/lowered/pass/fuse_loops.cpp similarity index 96% rename from src/common/snippets/src/lowered/pass/loop_fusion.cpp rename to src/common/snippets/src/lowered/pass/fuse_loops.cpp index cfc305d5dd245d..2f49ce4aca13ee 100644 --- a/src/common/snippets/src/lowered/pass/loop_fusion.cpp +++ b/src/common/snippets/src/lowered/pass/fuse_loops.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/lowered/pass/loop_fusion.hpp" +#include "snippets/lowered/pass/fuse_loops.hpp" #include "snippets/lowered/linear_ir.hpp" #include "snippets/lowered/loop_manager.hpp" @@ -17,9 +17,9 @@ namespace pass { using LoopManager = LinearIR::LoopManager; using LoopInfoPtr = LoopManager::LoopInfoPtr; -LoopFusion::LoopFusion() : Transformation() {} +FuseLoops::FuseLoops() : Transformation() {} -bool LoopFusion::can_be_fused(const LoopInfoPtr& loop_current, const LoopInfoPtr& loop_target) { +bool FuseLoops::can_be_fused(const LoopInfoPtr& loop_current, const LoopInfoPtr& loop_target) { auto current_work_amount = loop_current->work_amount; auto current_increment = loop_current->increment; auto target_work_amount = loop_target->work_amount; @@ -29,7 +29,7 @@ bool LoopFusion::can_be_fused(const LoopInfoPtr& loop_current, const LoopInfoPtr return supported_work_amount && supported_increment; } -void LoopFusion::fuse_points(LinearIR& linear_ir, std::vector& exit_points, std::vector& entry_points, +void FuseLoops::fuse_points(LinearIR& linear_ir, std::vector& exit_points, std::vector& entry_points, LinearIR::constExprIt loop_begin_pos, LinearIR::constExprIt loop_end_pos) { std::vector new_exit_points; for (const auto& exit_point : exit_points) { @@ -72,7 +72,7 @@ void LoopFusion::fuse_points(LinearIR& linear_ir, std::vector& e exit_points = new_exit_points; } -bool LoopFusion::fuse_upper_into_current(LinearIR& linear_ir, const LinearIR::LoopManagerPtr& loop_manager, +bool FuseLoops::fuse_upper_into_current(LinearIR& linear_ir, const LinearIR::LoopManagerPtr& loop_manager, const ExpressionPort& current_entry_point, const ExpressionPort& target_exit_point, size_t current_loop_id, size_t target_loop_id, size_t dim_idx, LinearIR::constExprIt& current_loop_begin_pos, LinearIR::constExprIt& current_loop_end_pos) { @@ -146,7 +146,7 @@ bool LoopFusion::fuse_upper_into_current(LinearIR& linear_ir, const LinearIR::Lo return true; } -bool LoopFusion::fuse_lower_into_current(LinearIR& linear_ir, const LinearIR::LoopManagerPtr& loop_manager, +bool FuseLoops::fuse_lower_into_current(LinearIR& linear_ir, const LinearIR::LoopManagerPtr& loop_manager, const ExpressionPort& current_exit_point, const ExpressionPort& target_entry_point, size_t current_loop_id, size_t target_loop_id, size_t dim_idx, LinearIR::constExprIt& current_loop_begin_pos, LinearIR::constExprIt& current_loop_end_pos) { @@ -216,8 +216,8 @@ bool LoopFusion::fuse_lower_into_current(LinearIR& linear_ir, const LinearIR::Lo return true; } -bool LoopFusion::run(LinearIR& linear_ir) { - OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::LoopFusion") +bool FuseLoops::run(LinearIR& linear_ir) { + OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::FuseLoops") if (linear_ir.empty()) return false; diff --git a/src/common/snippets/src/lowered/pass/buffer_identification.cpp b/src/common/snippets/src/lowered/pass/indentify_buffers.cpp similarity index 95% rename from src/common/snippets/src/lowered/pass/buffer_identification.cpp rename to src/common/snippets/src/lowered/pass/indentify_buffers.cpp index 0f6f710b422004..1a2b11d63a780a 100644 --- a/src/common/snippets/src/lowered/pass/buffer_identification.cpp +++ b/src/common/snippets/src/lowered/pass/indentify_buffers.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/lowered/pass/buffer_identification.hpp" +#include "snippets/lowered/pass/indentify_buffers.hpp" #include "snippets/lowered/linear_ir.hpp" #include "snippets/snippets_isa.hpp" @@ -24,7 +24,7 @@ inline size_t index(size_t col_num, size_t row, size_t col) { } } // namespace -std::vector BufferIdentification::create_adjacency_matrix(const LinearIR& linear_ir, const BufferSet& buffers) const { +std::vector IdentifyBuffers::create_adjacency_matrix(const LinearIR& linear_ir, const BufferSet& buffers) const { // The sync point to check for adjacency is Loop because only in Loop we increment pointers. // So if some Buffers in the one Loop have conflict (cannot be inplace: the different ptr increment and data sizes) // they are called as adjacent @@ -111,7 +111,7 @@ std::vector BufferIdentification::create_adjacency_matrix(const LinearIR& return adj; } -auto BufferIdentification::coloring(BufferSet& buffers, std::vector& adj) -> std::map { +auto IdentifyBuffers::coloring(BufferSet& buffers, std::vector& adj) -> std::map { size_t color = 0; std::map color_groups; const auto size = buffers.size(); @@ -156,8 +156,8 @@ auto BufferIdentification::coloring(BufferSet& buffers, std::vector& adj) return color_groups; } -bool BufferIdentification::run(LinearIR& linear_ir) { - OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::BufferIdentification") +bool IdentifyBuffers::run(LinearIR& linear_ir) { + OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::IdentifyBuffers") // Unite Buffers using Graph coloring algorithm. // Notes: We identify only Buffer with Intermediate memory because Buffers with new memory are used only in Brgemm case // so these Buffers are always IntermediateBuffer nonadjacent diff --git a/src/common/snippets/src/lowered/pass/loop_init.cpp b/src/common/snippets/src/lowered/pass/init_loops.cpp similarity index 94% rename from src/common/snippets/src/lowered/pass/loop_init.cpp rename to src/common/snippets/src/lowered/pass/init_loops.cpp index 8e03c1853e4973..460997d547a14e 100644 --- a/src/common/snippets/src/lowered/pass/loop_init.cpp +++ b/src/common/snippets/src/lowered/pass/init_loops.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/lowered/pass/loop_init.hpp" +#include "snippets/lowered/pass/init_loops.hpp" #include "snippets/lowered/linear_ir.hpp" #include "snippets/lowered/loop_manager.hpp" @@ -63,9 +63,9 @@ int64_t get_dim_stride(const size_t dim, const std::vector& layout, cons } } // namespace -LoopInit::LoopInit() : Transformation() {} +InitLoops::InitLoops() : Transformation() {} -std::vector LoopInit::init_ptr_increments(const std::vector& loop_inputs, +std::vector InitLoops::init_ptr_increments(const std::vector& loop_inputs, const std::vector& loop_outputs, size_t dim_idx) const { std::vector ptr_increments; @@ -125,7 +125,7 @@ std::vector LoopInit::init_ptr_increments(const std::vector LoopInit::init_finalization_offsets(const std::vector& ptr_increments, size_t work_amount) const { +std::vector InitLoops::init_finalization_offsets(const std::vector& ptr_increments, size_t work_amount) const { std::vector finalization_offsets; for (const auto& ptr_incr : ptr_increments) { int64_t offset = -1 * ptr_incr * work_amount; @@ -134,7 +134,7 @@ std::vector LoopInit::init_finalization_offsets(const std::vector LoopInit::init_element_type_sizes(const std::vector& loop_inputs, +std::vector InitLoops::init_element_type_sizes(const std::vector& loop_inputs, const std::vector& loop_outputs) { std::vector element_types; element_types.reserve(loop_inputs.size() + loop_outputs.size()); @@ -147,7 +147,7 @@ std::vector LoopInit::init_element_type_sizes(const std::vectorentry_exprs; auto loop_exits = loop_info->exit_exprs; @@ -184,8 +184,8 @@ bool LoopInit::insertion(LinearIR& linear_ir, const LinearIR::LoopManager::LoopI return true; } -bool LoopInit::run(LinearIR& linear_ir) { - OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::LoopInit") +bool InitLoops::run(LinearIR& linear_ir) { + OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::InitLoops") if (linear_ir.empty()) return false; diff --git a/src/common/snippets/src/lowered/pass/buffer_insertion.cpp b/src/common/snippets/src/lowered/pass/insert_buffers.cpp similarity index 96% rename from src/common/snippets/src/lowered/pass/buffer_insertion.cpp rename to src/common/snippets/src/lowered/pass/insert_buffers.cpp index be44dacdabd077..e1e795d13555e1 100644 --- a/src/common/snippets/src/lowered/pass/buffer_insertion.cpp +++ b/src/common/snippets/src/lowered/pass/insert_buffers.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/lowered/pass/buffer_insertion.hpp" +#include "snippets/lowered/pass/insert_buffers.hpp" #include "snippets/lowered/linear_ir.hpp" #include "snippets/lowered/loop_manager.hpp" @@ -15,10 +15,10 @@ namespace snippets { namespace lowered { namespace pass { -BufferInsertion::BufferInsertion(int32_t buffer_allocation_rank) +InsertBuffers::InsertBuffers(int32_t buffer_allocation_rank) : Transformation(), m_buffer_allocation_rank(buffer_allocation_rank) {} -LinearIR::constExprIt BufferInsertion::insertion_position(const LinearIR& linear_ir, const LinearIR::LoopManagerPtr& loop_manager, +LinearIR::constExprIt InsertBuffers::insertion_position(const LinearIR& linear_ir, const LinearIR::LoopManagerPtr& loop_manager, const ExpressionPtr& up_expr, const ExpressionPtr& down_expr) { const auto up_loops = up_expr->get_loop_ids(); const auto down_loops = down_expr->get_loop_ids(); @@ -57,7 +57,7 @@ LinearIR::constExprIt BufferInsertion::insertion_position(const LinearIR& linear } } -void BufferInsertion::insertion(LinearIR& linear_ir, const LinearIR::LoopManagerPtr& loop_manager, size_t loop_id, +void InsertBuffers::insertion(LinearIR& linear_ir, const LinearIR::LoopManagerPtr& loop_manager, size_t loop_id, const std::vector& loop_entries, const std::vector& loop_exits) { for (const auto& entry_point : loop_entries) { const auto expr = entry_point.expr; @@ -206,8 +206,8 @@ void BufferInsertion::insertion(LinearIR& linear_ir, const LinearIR::LoopManager } } -bool BufferInsertion::run(LinearIR& linear_ir) { - OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::BufferInsertion") +bool InsertBuffers::run(LinearIR& linear_ir) { + OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::InsertBuffers") if (linear_ir.empty()) return false; diff --git a/src/common/snippets/src/lowered/pass/load_store_insertion.cpp b/src/common/snippets/src/lowered/pass/insert_load_store.cpp similarity index 91% rename from src/common/snippets/src/lowered/pass/load_store_insertion.cpp rename to src/common/snippets/src/lowered/pass/insert_load_store.cpp index b97375e2378d36..f67ff2094382ec 100644 --- a/src/common/snippets/src/lowered/pass/load_store_insertion.cpp +++ b/src/common/snippets/src/lowered/pass/insert_load_store.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/lowered/pass/load_store_insertion.hpp" +#include "snippets/lowered/pass/insert_load_store.hpp" #include "snippets/lowered/linear_ir.hpp" #include "snippets/lowered/loop_manager.hpp" @@ -30,9 +30,9 @@ auto get_inner_loop_id(const std::vector& loop_ids) -> size_t { using LoopManager = LinearIR::LoopManager; using LoopInfoPtr = LoopManager::LoopInfoPtr; -LoadStoreInsertion::LoadStoreInsertion(size_t vector_size) : m_vector_size(vector_size) {} +InsertLoadStore::InsertLoadStore(size_t vector_size) : m_vector_size(vector_size) {} -void LoadStoreInsertion::update_loops(const LinearIR::LoopManagerPtr& loop_manager, const std::vector& loop_ids, +void InsertLoadStore::update_loops(const LinearIR::LoopManagerPtr& loop_manager, const std::vector& loop_ids, const ExpressionPort& actual_port, const std::vector& target_ports, bool is_entry) { for (auto loop_id : loop_ids) { if (loop_id != Expression::LOOP_NULL_ID) @@ -40,7 +40,7 @@ void LoadStoreInsertion::update_loops(const LinearIR::LoopManagerPtr& loop_manag } } -void LoadStoreInsertion::update_loop(const LinearIR::LoopManager::LoopInfoPtr& loop_info, +void InsertLoadStore::update_loop(const LinearIR::LoopManager::LoopInfoPtr& loop_info, const ExpressionPort& actual_port, const std::vector& target_ports, bool is_entry) { auto& ports = is_entry ? loop_info->entry_exprs : loop_info->exit_exprs; auto port_it = std::find(ports.begin(), ports.end(), actual_port); @@ -50,7 +50,7 @@ void LoadStoreInsertion::update_loop(const LinearIR::LoopManager::LoopInfoPtr& l ports.insert(port_it, target_ports.cbegin(), target_ports.cend()); } -bool LoadStoreInsertion::insert_load(LinearIR& linear_ir, const LinearIR::constExprIt& data_expr_it) { +bool InsertLoadStore::insert_load(LinearIR& linear_ir, const LinearIR::constExprIt& data_expr_it) { const auto& loop_manager = linear_ir.get_loop_manager(); const auto& data_expr = *data_expr_it; const auto& data_node = data_expr->get_node(); @@ -93,7 +93,7 @@ bool LoadStoreInsertion::insert_load(LinearIR& linear_ir, const LinearIR::constE return was_inserted; } -bool LoadStoreInsertion::insert_store(LinearIR& linear_ir, const LinearIR::constExprIt& data_expr_it) { +bool InsertLoadStore::insert_store(LinearIR& linear_ir, const LinearIR::constExprIt& data_expr_it) { const auto& loop_manager = linear_ir.get_loop_manager(); const auto& data_expr = *data_expr_it; const auto& input_td = data_expr->get_inputs().front(); @@ -141,8 +141,8 @@ bool LoadStoreInsertion::insert_store(LinearIR& linear_ir, const LinearIR::const return true; } -bool LoadStoreInsertion::run(LinearIR& linear_ir) { - OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::LoadStoreInsertion") +bool InsertLoadStore::run(LinearIR& linear_ir) { + OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::InsertLoadStore") bool modified = false; for (auto expr_it = linear_ir.begin(); expr_it != linear_ir.end(); expr_it++) { diff --git a/src/common/snippets/src/lowered/pass/loop_markup.cpp b/src/common/snippets/src/lowered/pass/mark_loops.cpp similarity index 94% rename from src/common/snippets/src/lowered/pass/loop_markup.cpp rename to src/common/snippets/src/lowered/pass/mark_loops.cpp index eabb8839317384..4380ec9ca41072 100644 --- a/src/common/snippets/src/lowered/pass/loop_markup.cpp +++ b/src/common/snippets/src/lowered/pass/mark_loops.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/lowered/pass/loop_markup.hpp" +#include "snippets/lowered/pass/mark_loops.hpp" #include "snippets/lowered/linear_ir.hpp" #include "snippets/lowered/loop_manager.hpp" @@ -14,10 +14,10 @@ namespace snippets { namespace lowered { namespace pass { -LoopMarkup::LoopMarkup(size_t vector_size) : Transformation(), m_vector_size(vector_size) {} +MarkLoops::MarkLoops(size_t vector_size) : Transformation(), m_vector_size(vector_size) {} -bool LoopMarkup::run(LinearIR& linear_ir) { - OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::LoopMarkup") +bool MarkLoops::run(LinearIR& linear_ir) { + OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::MarkLoops") if (linear_ir.empty()) return false; diff --git a/src/common/snippets/src/lowered/pass/buffer_reset.cpp b/src/common/snippets/src/lowered/pass/reset_buffers.cpp similarity index 93% rename from src/common/snippets/src/lowered/pass/buffer_reset.cpp rename to src/common/snippets/src/lowered/pass/reset_buffers.cpp index c826c584c21534..89dad68eb0ed5d 100644 --- a/src/common/snippets/src/lowered/pass/buffer_reset.cpp +++ b/src/common/snippets/src/lowered/pass/reset_buffers.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/lowered/pass/buffer_reset.hpp" +#include "snippets/lowered/pass/reset_buffers.hpp" #include "snippets/lowered/linear_ir.hpp" #include "snippets/snippets_isa.hpp" @@ -13,7 +13,7 @@ namespace snippets { namespace lowered { namespace pass { -bool BufferReset::reuse_buffer_increments(const LinearIR& linear_ir, const ExpressionPtr& loop_end_expr) { +bool ResetBuffers::reuse_buffer_increments(const LinearIR& linear_ir, const ExpressionPtr& loop_end_expr) { const auto loop_end = ov::as_type_ptr(loop_end_expr->get_node()); if (!loop_end) return false; @@ -75,8 +75,8 @@ bool BufferReset::reuse_buffer_increments(const LinearIR& linear_ir, const Expre return true; } -bool BufferReset::run(LinearIR& linear_ir) { - OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::BufferReset") +bool ResetBuffers::run(LinearIR& linear_ir) { + OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::ResetBuffers") bool modified = false; for (const auto& expr : linear_ir) { diff --git a/src/common/snippets/src/lowered/pass/softmax_decomposition.cpp b/src/common/snippets/src/lowered/pass/softmax_decomposition.cpp index ed6a1a34eb9422..b491dfe1172fce 100644 --- a/src/common/snippets/src/lowered/pass/softmax_decomposition.cpp +++ b/src/common/snippets/src/lowered/pass/softmax_decomposition.cpp @@ -6,7 +6,7 @@ #include "snippets/lowered/linear_ir.hpp" #include "snippets/lowered/loop_manager.hpp" -#include "snippets/lowered/pass/loop_markup.hpp" +#include "snippets/lowered/pass/mark_loops.hpp" #include "snippets/snippets_isa.hpp" #include "snippets/itt.hpp"