From e5226808838e7d6fcedae56ae63c1c691755a5bd Mon Sep 17 00:00:00 2001 From: Arseniy Obolenskiy Date: Fri, 17 Jan 2025 10:37:25 +0100 Subject: [PATCH] Address review comments --- .../lowered/pass/brgemm_debug_params.hpp | 57 ++++++++++++------- .../snippets/src/lowered/expression.cpp | 2 +- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/common/snippets/include/snippets/lowered/pass/brgemm_debug_params.hpp b/src/common/snippets/include/snippets/lowered/pass/brgemm_debug_params.hpp index c9442ee803f223..00d706a3f37f50 100644 --- a/src/common/snippets/include/snippets/lowered/pass/brgemm_debug_params.hpp +++ b/src/common/snippets/include/snippets/lowered/pass/brgemm_debug_params.hpp @@ -89,23 +89,23 @@ class BrgemmDebugParams : public snippets::lowered::pass::RangedPass { } } ss << ','; - auto append_shape_info = [&](const auto& ports, auto get_port_descriptor) { - for (size_t i = 0; i < ports.size(); ++i) { - const auto& shape = ov::snippets::utils::get_planar_vdims(get_port_descriptor(i)->get_shape(), - get_port_descriptor(i)->get_layout()); - ss << utils::tensor2str(shape, " "); - ss << ';'; - } - ss.seekp(-1, ss.cur); - ss << ','; - }; - - append_shape_info(brgemm->inputs(), [&](size_t i) { - return brgemm_expr->get_input_port_descriptor(i); - }); - append_shape_info(brgemm->outputs(), [&](size_t i) { - return brgemm_expr->get_output_port_descriptor(i); - }); + for (size_t i = 0; i < brgemm->inputs().size(); ++i) { + const auto& port_desc = brgemm_expr->get_input_port_descriptor(i); + const auto& shape = ov::snippets::utils::get_planar_vdims(port_desc->get_shape(), port_desc->get_layout()); + ss << utils::tensor2str(shape, " "); + ss << ';'; + } + ss.seekp(-1, ss.cur); + ss << ','; + for (size_t i = 0; i < brgemm->outputs().size(); ++i) { + const auto& port_desc = brgemm_expr->get_output_port_descriptor(i); + const auto& shape = + ov::snippets::utils::get_preordered_vdims(port_desc->get_shape(), port_desc->get_layout()); + ss << utils::tensor2str(shape, " "); + ss << ';'; + } + ss.seekp(-1, ss.cur); + ss << ','; const auto& in_0_desc = brgemm_expr->get_input_port_descriptor(0); const auto& in_1_desc = brgemm_expr->get_input_port_descriptor(1); @@ -127,11 +127,24 @@ class BrgemmDebugParams : public snippets::lowered::pass::RangedPass { "Brgemm input descriptors have incompatible K dimension value."); ss << static_cast(m) << ',' << static_cast(n) << ',' << static_cast(k) << ','; - int64_t m_block = in_0_desc->get_subtensor().front(); - int64_t n_block = in_1_desc->get_subtensor().back(); - int64_t k_block = out_desc->get_subtensor().back(); - ss << m_block << ',' << n_block << ',' << k_block; - ss << ','; + size_t m_block = in_0_desc->get_subtensor().front(); + size_t n_block = in_1_desc->get_subtensor().back(); + size_t k_block = out_desc->get_subtensor().back(); + + auto append_block_info = [&](size_t block) { + if (block == utils::get_full_dim_value()) { + ss << "FULL_DIM"; + } else if (block == utils::get_dynamic_value()) { + ss << "?"; + } else { + ss << block; + } + ss << ','; + }; + + append_block_info(m_block); + append_block_info(n_block); + append_block_info(k_block); return ss.str(); } diff --git a/src/common/snippets/src/lowered/expression.cpp b/src/common/snippets/src/lowered/expression.cpp index cefed61c16e737..7389990cba54dc 100644 --- a/src/common/snippets/src/lowered/expression.cpp +++ b/src/common/snippets/src/lowered/expression.cpp @@ -170,7 +170,7 @@ ExpressionPtr Expression::clone() const { } bool Expression::visit_attributes(AttributeVisitor &visitor) { - std::vector in_regs, out_regs; + std::ostringstream in_regs, out_regs; std::vector> shapes; std::vector> subtensors; std::vector>> layouts;