Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[Snippets] BufferExpression::init_allocation_size fix (#32177)

Vladislav Golubev27437574f5b8
diff --git a/src/common/snippets/src/lowered/expressions/buffer_expression.cpp b/src/common/snippets/src/lowered/expressions/buffer_expression.cpp
index 14188cdf6ce..e5a455d4e80 100644
--- a/src/common/snippets/src/lowered/expressions/buffer_expression.cpp
+++ b/src/common/snippets/src/lowered/expressions/buffer_expression.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2024 Intel Corporation
+// Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
@@ -129,6 +129,11 @@ void BufferExpression::init_allocation_size(const std::shared_ptr<LoopManager>&
continue;
}
const auto& dim_idx = loop_port.get_dim_idx();
+ // loops are traversed from outer to inner, so if the dimension index is already processed,
+ // then the current loop work amount was already taken into account when outer loop was processed
+ if (processed_dim_idxs.count(dim_idx) > 0) {
+ continue;
+ }
if (dim_idx < rank) {
if (const auto& unified_loop_info = ov::as_type_ptr<UnifiedLoopInfo>(loop_info)) {
m_allocation_size = utils::dynamic_safe_mul(m_allocation_size, unified_loop_info->get_work_amount());
diff --git a/src/common/snippets/tests/include/lir_comparator.hpp b/src/common/snippets/tests/include/lir_comparator.hpp
index e10e6f5b1a3..93e7b704827 100644
--- a/src/common/snippets/tests/include/lir_comparator.hpp
+++ b/src/common/snippets/tests/include/lir_comparator.hpp
@@ -25,6 +25,7 @@ public:
PORT_CONNECTORS = 1 << 1,
LOOP_INDICES = 1 << 2,
LOOP_MANAGER = 1 << 3,
+ EXPR_ATTRS = 1 << 4,
};
// Creates LIRComparator with all CmpValues disabled
@@ -69,6 +70,10 @@ private:
return m_lir_cmp_values & f;
}
+ bool should_compare(NodesCmpValues f) const noexcept {
+ return m_nodes_cmp_values & f;
+ }
+
static Result compare_descs(const std::vector<ov::snippets::lowered::PortDescriptorPtr>& descs,
const std::vector<ov::snippets::lowered::PortDescriptorPtr>& descs_ref);
diff --git a/src/common/snippets/tests/include/lir_test_utils.hpp b/src/common/snippets/tests/include/lir_test_utils.hpp
index 9c62455f667..a9b1f3f320c 100644
--- a/src/common/snippets/tests/include/lir_test_utils.hpp
+++ b/src/common/snippets/tests/include/lir_test_utils.hpp
@@ -11,6 +11,7 @@
#include "lir_comparator.hpp"
#include "snippets/lowered/expression.hpp"
#include "snippets/lowered/linear_ir.hpp"
+#include "snippets/lowered/loop_info.hpp"
#include "snippets/lowered/pass/pass.hpp"
namespace ov {
@@ -67,6 +68,24 @@ void init_expr_descriptors(const ov::snippets::lowered::ExpressionPtr& expr,
const std::vector<ov::snippets::VectorDims>& subtensors = {},
const std::vector<ov::snippets::VectorDims>& layouts = {});
+/**
+ * @brief Creates an InnerSplittedUnifiedLoopInfo which represents an inner loop that appears
+ * after SplitLoops optimizations.
+ *
+ * @param work_amount work amount of original loop before splitting
+ * @param increment increment for each iteration
+ * @param entries Vector of LoopPort objects representing loop entry points (input ports)
+ * @param exits Vector of LoopPort objects representing loop exit points (output ports)
+ * @param outer_split_loop_info Pointer to the outer split loop info that will contain this inner loop
+ * @return Shared pointer to the created InnerSplittedUnifiedLoopInfo
+ */
+ov::snippets::lowered::InnerSplittedUnifiedLoopInfoPtr make_inner_split_loop_info(
+ size_t work_amount,
+ size_t increment,
+ const std::vector<ov::snippets::lowered::LoopPort>& entries,
+ const std::vector<ov::snippets::lowered::LoopPort>& exits,
+ const ov::snippets::lowered::UnifiedLoopInfoPtr& outer_split_loop_info);
+
} // namespace snippets
} // namespace test
} // namespace ov
diff --git a/src/common/snippets/tests/src/lir_comparator.cpp b/src/common/snippets/tests/src/lir_comparator.cpp
index e5edc730a08..0893b49ec92 100644
--- a/src/common/snippets/tests/src/lir_comparator.cpp
+++ b/src/common/snippets/tests/src/lir_comparator.cpp
@@ -72,6 +72,23 @@ LIRComparator::Result LIRComparator::compare(const LinearIRPtr& linear_ir,
auto run_comparison = [&](const ExpressionPtr& expr, const ExpressionPtr& expr_ref) {
const auto node = expr->get_node();
const auto node_ref = expr_ref->get_node();
+ if (should_compare(LIRCmpValues::EXPR_ATTRS)) {
+ bool node_attrs_comparison_disabled = !should_compare(NodesCmpValues::ATTRIBUTES);
+ // WA: NodesCmpValues::ATTRIBUTES is used for expressions attributes comparison
+ // so it must be temporarily forced to true for expressions attributes comparison
+ if (node_attrs_comparison_disabled)
+ enable(NodesCmpValues::ATTRIBUTES);
+ attributes::detail::CompareNodesAttributes compare_expr_attr(m_nodes_cmp_values);
+ expr_ref->visit_attributes(compare_expr_attr.get_ref_reader());
+ expr->visit_attributes(compare_expr_attr.get_cmp_reader());
+ if (!compare_expr_attr.equal()) {
+ return Result::error("Comparison of attributes failed for exprs " + name(node_ref) + ", " + name(node) +
+ " [cmp status (ref vs target): " + to_str(compare_expr_attr) + "]");
+ }
+ if (node_attrs_comparison_disabled)
+ disable(NodesCmpValues::ATTRIBUTES);
+ }
+
if (m_nodes_cmp_values != NodesCmpValues::NONE)
PROPAGATE_ERROR("", Comparator(m_nodes_cmp_values).compare(node.get(), node_ref.get()));
diff --git a/src/common/snippets/tests/src/lir_test_utils.cpp b/src/common/snippets/tests/src/lir_test_utils.cpp
index 35e1c27a426..326a9afe5d6 100644
--- a/src/common/snippets/tests/src/lir_test_utils.cpp
+++ b/src/common/snippets/tests/src/lir_test_utils.cpp
@@ -5,8 +5,10 @@
#include "lir_test_utils.hpp"
#include "snippets/lowered/linear_ir_builder.hpp"
+#include "snippets/lowered/pass/split_loops.hpp"
#include "snippets/utils/utils.hpp"
+using namespace ov::snippets::lowered::pass;
using namespace ov::snippets::lowered;
using namespace ov::snippets::utils;
using namespace ov::snippets;
@@ -98,6 +100,27 @@ void init_expr_descriptors(const ov::snippets::lowered::ExpressionPtr& expr,
}
}
+InnerSplittedUnifiedLoopInfoPtr make_inner_split_loop_info(size_t work_amount,
+ size_t increment,
+ const std::vector<LoopPort>& entries,
+ const std::vector<LoopPort>& exits,
+ const UnifiedLoopInfoPtr& outer_split_loop_info) {
+ outer_split_loop_info
+ ->register_pass_to_handler<SpecificLoopIterType::MAIN_BODY, SplitLoops::TransformInnerSplitLoop>();
+ outer_split_loop_info
+ ->register_pass_to_handler<SpecificLoopIterType::LAST_ITER, SplitLoops::TransformInnerSplitLoop>();
+ // Note: this temporary loop is needed to easily create InnerSplittedUnifiedLoopInfo:
+ // we extract all automatically calculated parameters from it such as LoopPortDesc and SpecificIterationHandlers
+ const auto tmp_unified_loop = std::make_shared<UnifiedLoopInfo>(work_amount, increment, entries, exits, false);
+ return std::make_shared<InnerSplittedUnifiedLoopInfo>(tmp_unified_loop->get_increment(),
+ tmp_unified_loop->get_input_ports(),
+ tmp_unified_loop->get_output_ports(),
+ tmp_unified_loop->get_input_port_descs(),
+ tmp_unified_loop->get_output_port_descs(),
+ tmp_unified_loop->get_handlers(),
+ outer_split_loop_info);
+}
+
} // namespace snippets
} // namespace test
} // namespace ov
diff --git a/src/common/snippets/tests/src/lowered/pass/compute_buffer_allocation_size.cpp b/src/common/snippets/tests/src/lowered/pass/compute_buffer_allocation_size.cpp
new file mode 100644
index 00000000000..26100671dff
--- /dev/null
+++ b/src/common/snippets/tests/src/lowered/pass/compute_buffer_allocation_size.cpp
@@ -0,0 +1,276 @@
+// Copyright (C) 2018-2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include "snippets/lowered/pass/compute_buffer_allocation_size.hpp"
+
+#include "lir_test_utils.hpp"
+#include "openvino/op/add.hpp"
+#include "openvino/op/parameter.hpp"
+#include "openvino/op/result.hpp"
+#include "snippets/op/brgemm.hpp"
+#include "snippets/op/buffer.hpp"
+
+namespace ov {
+namespace test {
+namespace snippets {
+
+using namespace ov::snippets::lowered;
+using namespace ov::snippets::lowered::pass;
+using PortType = LoopPort::Type;
+
+class ComputeBufferAllocationSizeTest : public LoweredPassTestsF {
+public:
+ ComputeBufferAllocationSizeTest() : LoweredPassTestsF() {
+ comparator.enable(LIRComparator::LIRCmpValues::EXPR_ATTRS);
+ }
+
+ void SetUp() override {
+ pipeline.register_pass<ComputeBufferAllocationSize>();
+ }
+
+ size_t vector_size = 16;
+ ov::element::Type input_precision = ov::element::f32;
+ size_t m_block = 32;
+ size_t n_block = 64;
+};
+
+/*
+ * Control Flow Graph:
+ * LoopBegin (blocking_m_loop)
+ * | LoopBegin (brgemm1_n_loop)
+ * | | Brgemm1
+ * | LoopEnd (brgemm1_n_loop)
+ * |
+ * | Buffer1
+ * |
+ * | LoopBegin (add_m_split_loop)
+ * | | LoopBegin (inner_add_loop)
+ * | | Add
+ * | | LoopEnd (inner_add_loop)
+ * | LoopEnd (add_m_split_loop)
+ * |
+ * | Buffer2
+ * |
+ * | LoopBegin (brgemm2_n2_loop)
+ * | | Brgemm2
+ * | LoopEnd (brgemm2_n2_loop)
+ * LoopEnd (blocking_m_loop)
+ */
+TEST_F(ComputeBufferAllocationSizeTest, BrgemmAddBrgemmSplitM) {
+ const size_t m = 64;
+ const size_t n = 128;
+ const size_t k = 512;
+ const size_t n2 = 256;
+ const ov::Shape input_shape_0{1, 1, m, k};
+ const ov::Shape input_shape_1{1, 1, k, n};
+ const ov::Shape input_shape_2{1, 1, m, n};
+ const ov::Shape input_shape_3{1, 1, n, n2};
+ const ov::snippets::VectorDims brgemm_a_subtensor{m_block, ov::snippets::utils::get_full_dim_value()};
+ const ov::snippets::VectorDims brgemm_b_subtensor{ov::snippets::utils::get_full_dim_value(), n_block};
+ const ov::snippets::VectorDims brgemm_c_subtensor{m_block, n_block};
+
+ auto build_lir = [&](const std::shared_ptr<ov::snippets::lowered::LinearIR>& lir) {
+ lir->set_loop_depth(2);
+ auto param0 = lir->push_node<ov::op::v0::Parameter>(input_precision, input_shape_0);
+ auto param1 = lir->push_node<ov::op::v0::Parameter>(input_precision, input_shape_1);
+ auto param2 = lir->push_node<ov::op::v0::Parameter>(input_precision, input_shape_2);
+ auto param3 = lir->push_node<ov::op::v0::Parameter>(input_precision, input_shape_3);
+ auto brgemm1 = lir->push_node<ov::snippets::op::Brgemm>(param0.second, param1.second);
+ init_expr_descriptors(*brgemm1.first, {brgemm_a_subtensor, brgemm_b_subtensor, brgemm_c_subtensor});
+ auto buffer1 = lir->push_node<ov::snippets::op::Buffer>(brgemm1.second);
+ auto add = lir->push_node<ov::op::v1::Add>(buffer1.second, param2.second);
+ auto buffer2 = lir->push_node<ov::snippets::op::Buffer>(add.second);
+ auto brgemm2 = lir->push_node<ov::snippets::op::Brgemm>(buffer2.second, param3.second);
+ init_expr_descriptors(*brgemm2.first, {brgemm_a_subtensor, brgemm_b_subtensor, brgemm_c_subtensor});
+ auto result = lir->push_node<ov::op::v0::Result>(brgemm2.second);
+
+ const auto& loop_manager = lir->get_loop_manager();
+
+ // Brgemm1 n-blocking loop
+ const auto brgemm1_n_loop = std::make_shared<UnifiedLoopInfo>(
+ n,
+ n_block,
+ std::vector<LoopPort>{LoopPort::create<PortType::NotProcessed>((*brgemm1.first)->get_input_port(0)),
+ LoopPort::create<PortType::Incremented>((*brgemm1.first)->get_input_port(1), 0)},
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*brgemm1.first)->get_output_port(0), 0)},
+ false);
+ const auto brgemm1_blocking_n_loop_id = loop_manager->add_loop_info(brgemm1_n_loop);
+
+ // Brgemm2 n2-blocking loop
+ const auto brgemm2_n2_loop = std::make_shared<UnifiedLoopInfo>(
+ n2,
+ vector_size,
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*brgemm2.first)->get_input_port(0), 0),
+ LoopPort::create<PortType::Incremented>((*brgemm2.first)->get_input_port(1), 0)},
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*brgemm2.first)->get_output_port(0), 0)},
+ false);
+ const auto brgemm2_blocking_n2_loop_id = loop_manager->add_loop_info(brgemm2_n2_loop);
+
+ // Shared m-blocking loop for brgemm1, add, and brgemm2
+ const auto blocking_m_loop = std::make_shared<UnifiedLoopInfo>(
+ m,
+ m_block,
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*brgemm1.first)->get_input_port(0), 1),
+ LoopPort::create<PortType::NotProcessed>((*brgemm1.first)->get_input_port(1)),
+ LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(1), 1),
+ LoopPort::create<PortType::NotProcessed>((*brgemm2.first)->get_input_port(1))},
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*brgemm2.first)->get_output_port(0), 1)},
+ false);
+ const auto blocking_m_loop_id = loop_manager->add_loop_info(blocking_m_loop);
+
+ const auto inner_add_loop = std::make_shared<UnifiedLoopInfo>(
+ n,
+ vector_size,
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(0), 0),
+ LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(1), 0)},
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*add.first)->get_output_port(0), 0)},
+ false);
+ const auto inner_add_loop_id = loop_manager->add_loop_info(inner_add_loop);
+
+ const auto add_m_split_loop = make_inner_split_loop_info(
+ m,
+ 1,
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(0), 1),
+ LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(1), 1)},
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*add.first)->get_output_port(0), 1)},
+ blocking_m_loop);
+ const auto add_m_split_loop_id = loop_manager->add_loop_info(add_m_split_loop);
+ (*brgemm1.first)->set_loop_ids({blocking_m_loop_id, brgemm1_blocking_n_loop_id});
+ (*buffer1.first)->set_loop_ids({blocking_m_loop_id});
+ (*add.first)->set_loop_ids({blocking_m_loop_id, add_m_split_loop_id, inner_add_loop_id});
+ (*buffer2.first)->set_loop_ids({blocking_m_loop_id});
+ (*brgemm2.first)->set_loop_ids({blocking_m_loop_id, brgemm2_blocking_n2_loop_id});
+
+ const auto buffer_after_brgemm1_expr = ov::as_type_ptr<BufferExpression>(*buffer1.first);
+ const auto buffer_before_brgemm2_expr = ov::as_type_ptr<BufferExpression>(*buffer2.first);
+ return std::make_tuple(buffer_after_brgemm1_expr, buffer_before_brgemm2_expr);
+ };
+
+ build_lir(linear_ir);
+ const auto& [buffer1, buffer2] = build_lir(linear_ir_ref);
+ buffer1->set_allocation_size(m_block * n);
+ buffer2->set_allocation_size(m_block * n);
+}
+
+
+/*
+ * Control Flow Graph:
+ * LoopBegin (blocking_m_loop)
+ * | LoopBegin (blocking_n_loop)
+ * | | Brgemm1
+ * | | Buffer1
+ * | | LoopBegin (add_m_split_loop)
+ * | | | LoopBegin (add_n_split_loop)
+ * | | | | Add
+ * | | | LoopEnd (add_n_split_loop)
+ * | | LoopEnd (add_m_split_loop)
+ * | LoopEnd (blocking_n_loop)
+ * |
+ * | Buffer2
+ * |
+ * | LoopBegin (brgemm2_n2_loop)
+ * | | Brgemm2
+ * | LoopEnd (brgemm2_n2_loop)
+ * LoopEnd (blocking_m_loop)
+ */
+TEST_F(ComputeBufferAllocationSizeTest, BrgemmAddBrgemmSplitMN) {
+ const size_t m = 64;
+ const size_t n = 128;
+ const size_t k = 512;
+ const size_t n2 = 256;
+ const ov::Shape input_shape_0{1, 1, m, k};
+ const ov::Shape input_shape_1{1, 1, k, n};
+ const ov::Shape input_shape_2{1, 1, m, n};
+ const ov::Shape input_shape_3{1, 1, n, n2};
+ const ov::snippets::VectorDims brgemm_a_subtensor{m_block, ov::snippets::utils::get_full_dim_value()};
+ const ov::snippets::VectorDims brgemm_b_subtensor{ov::snippets::utils::get_full_dim_value(), n_block};
+ const ov::snippets::VectorDims brgemm_c_subtensor{m_block, n_block};
+
+ auto build_lir = [&](const std::shared_ptr<ov::snippets::lowered::LinearIR>& lir) {
+ lir->set_loop_depth(2);
+ auto param0 = lir->push_node<ov::op::v0::Parameter>(input_precision, input_shape_0);
+ auto param1 = lir->push_node<ov::op::v0::Parameter>(input_precision, input_shape_1);
+ auto param2 = lir->push_node<ov::op::v0::Parameter>(input_precision, input_shape_2);
+ auto param3 = lir->push_node<ov::op::v0::Parameter>(input_precision, input_shape_3);
+ auto brgemm1 = lir->push_node<ov::snippets::op::Brgemm>(param0.second, param1.second);
+ init_expr_descriptors(*brgemm1.first, {brgemm_a_subtensor, brgemm_b_subtensor, brgemm_c_subtensor});
+ auto buffer1 = lir->push_node<ov::snippets::op::Buffer>(brgemm1.second);
+ auto add = lir->push_node<ov::op::v1::Add>(buffer1.second, param2.second);
+ auto buffer2 = lir->push_node<ov::snippets::op::Buffer>(add.second);
+ auto brgemm2 = lir->push_node<ov::snippets::op::Brgemm>(buffer2.second, param3.second);
+ init_expr_descriptors(*brgemm2.first, {brgemm_a_subtensor, brgemm_b_subtensor, brgemm_c_subtensor});
+ auto result = lir->push_node<ov::op::v0::Result>(brgemm2.second);
+
+ const auto& loop_manager = lir->get_loop_manager();
+
+ // Brgemm1 n-blocking loop
+ const auto blocking_n_loop = std::make_shared<UnifiedLoopInfo>(
+ n,
+ n_block,
+ std::vector<LoopPort>{LoopPort::create<PortType::NotProcessed>((*brgemm1.first)->get_input_port(0)),
+ LoopPort::create<PortType::Incremented>((*brgemm1.first)->get_input_port(1), 0),
+ LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(1), 0)},
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*add.first)->get_output_port(0), 0)},
+ false);
+ const auto blocking_n_loop_id = loop_manager->add_loop_info(blocking_n_loop);
+
+ const auto add_n_split_loop = make_inner_split_loop_info(
+ n,
+ vector_size,
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(0), 0),
+ LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(1), 0)},
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*add.first)->get_output_port(0), 0)},
+ blocking_n_loop);
+ const auto add_n_split_loop_id = loop_manager->add_loop_info(add_n_split_loop);
+
+ // Brgemm2 n2-blocking loop
+ const auto brgemm2_n2_loop = std::make_shared<UnifiedLoopInfo>(
+ n2,
+ vector_size,
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*brgemm2.first)->get_input_port(0), 0),
+ LoopPort::create<PortType::Incremented>((*brgemm2.first)->get_input_port(1), 0)},
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*brgemm2.first)->get_output_port(0), 0)},
+ false);
+ const auto brgemm2_blocking_n2_loop_id = loop_manager->add_loop_info(brgemm2_n2_loop);
+
+ // Shared m-blocking loop for brgemm1, add, and brgemm2
+ const auto blocking_m_loop = std::make_shared<UnifiedLoopInfo>(
+ m,
+ m_block,
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*brgemm1.first)->get_input_port(0), 1),
+ LoopPort::create<PortType::NotProcessed>((*brgemm1.first)->get_input_port(1)),
+ LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(1), 1),
+ LoopPort::create<PortType::NotProcessed>((*brgemm2.first)->get_input_port(1))},
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*brgemm2.first)->get_output_port(0), 1)},
+ false);
+ const auto blocking_m_loop_id = loop_manager->add_loop_info(blocking_m_loop);
+
+ const auto add_m_split_loop = make_inner_split_loop_info(
+ m,
+ 1,
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(0), 1),
+ LoopPort::create<PortType::Incremented>((*add.first)->get_input_port(1), 1)},
+ std::vector<LoopPort>{LoopPort::create<PortType::Incremented>((*add.first)->get_output_port(0), 1)},
+ blocking_m_loop);
+ const auto add_m_split_loop_id = loop_manager->add_loop_info(add_m_split_loop);
+
+ (*brgemm1.first)->set_loop_ids({blocking_m_loop_id, blocking_n_loop_id});
+ (*buffer1.first)->set_loop_ids({blocking_m_loop_id, blocking_n_loop_id});
+ (*add.first)->set_loop_ids({blocking_m_loop_id, blocking_n_loop_id, add_m_split_loop_id, add_n_split_loop_id});
+ (*buffer2.first)->set_loop_ids({blocking_m_loop_id});
+ (*brgemm2.first)->set_loop_ids({blocking_m_loop_id, brgemm2_blocking_n2_loop_id});
+
+ const auto buffer_after_brgemm1_expr = ov::as_type_ptr<BufferExpression>(*buffer1.first);
+ const auto buffer_before_brgemm2_expr = ov::as_type_ptr<BufferExpression>(*buffer2.first);
+ return std::make_tuple(buffer_after_brgemm1_expr, buffer_before_brgemm2_expr);
+ };
+
+ build_lir(linear_ir);
+ const auto& [buffer1, buffer2] = build_lir(linear_ir_ref);
+ buffer1->set_allocation_size(m_block * n_block);
+ buffer2->set_allocation_size(m_block * n);
+}
+} // namespace snippets
+} // namespace test
+} // namespace ov
diff --git a/src/common/snippets/tests/src/lowered/pass/split_loops.cpp b/src/common/snippets/tests/src/lowered/pass/split_loops.cpp
index ae6932fd8e1..0ad40b88b2f 100644
--- a/src/common/snippets/tests/src/lowered/pass/split_loops.cpp
+++ b/src/common/snippets/tests/src/lowered/pass/split_loops.cpp
@@ -18,29 +18,6 @@ using namespace ov::snippets::lowered;
using namespace ov::snippets::lowered::pass;
using PortType = LoopPort::Type;
-namespace {
-InnerSplittedUnifiedLoopInfoPtr make_inner_split_loop_info(size_t work_amount,
- size_t increment,
- const std::vector<LoopPort>& entries,
- const std::vector<LoopPort>& exits,
- const UnifiedLoopInfoPtr& outer_split_loop_info) {
- outer_split_loop_info
- ->register_pass_to_handler<SpecificLoopIterType::MAIN_BODY, SplitLoops::TransformInnerSplitLoop>();
- outer_split_loop_info
- ->register_pass_to_handler<SpecificLoopIterType::LAST_ITER, SplitLoops::TransformInnerSplitLoop>();
- // Note: this temporary loop is needed to easily create InnerSplittedUnifiedLoopInfo:
- // we extract all automatically calculated parameters from it such as LoopPortDesc and SpecificIterationHandlers
- const auto tmp_unified_loop = std::make_shared<UnifiedLoopInfo>(work_amount, increment, entries, exits, false);
- return std::make_shared<InnerSplittedUnifiedLoopInfo>(tmp_unified_loop->get_increment(),
- tmp_unified_loop->get_input_ports(),
- tmp_unified_loop->get_output_ports(),
- tmp_unified_loop->get_input_port_descs(),
- tmp_unified_loop->get_output_port_descs(),
- tmp_unified_loop->get_handlers(),
- outer_split_loop_info);
-}
-} // namespace
-
class SplitLoopsTest : public LoweredPassTestsF {
public:
SplitLoopsTest() : LoweredPassTestsF() {