Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aobolensk committed Jan 17, 2025
1 parent c0bfa84 commit e522680
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -127,11 +127,24 @@ class BrgemmDebugParams : public snippets::lowered::pass::RangedPass {
"Brgemm input descriptors have incompatible K dimension value.");
ss << static_cast<int64_t>(m) << ',' << static_cast<int64_t>(n) << ',' << static_cast<int64_t>(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<size_t>()) {
ss << "?";
} else {
ss << block;
}
ss << ',';
};

append_block_info(m_block);
append_block_info(n_block);
append_block_info(k_block);
return ss.str();
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/snippets/src/lowered/expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ ExpressionPtr Expression::clone() const {
}

bool Expression::visit_attributes(AttributeVisitor &visitor) {
std::vector<size_t> in_regs, out_regs;
std::ostringstream in_regs, out_regs;
std::vector<std::pair<std::string, ov::PartialShape>> shapes;
std::vector<std::pair<std::string, std::string>> subtensors;
std::vector<std::pair<std::string, std::vector<size_t>>> layouts;
Expand Down

0 comments on commit e522680

Please sign in to comment.