Skip to content

Commit

Permalink
Fixes and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
v-Golubev committed Oct 18, 2024
1 parent a386ac2 commit f45c4fa
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/common/snippets/src/runtime_configurator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ void RuntimeConfigurator::update_data_offsets(const std::vector<VectorDims>& sha
const std::vector<std::vector<size_t>>& layouts) const {
OPENVINO_ASSERT(shapes.size() == m_io_num, "Number of custom shapes must be 0 or be equal to m_io_num");
OPENVINO_ASSERT(layouts.size() == m_io_num, "Number of custom layouts must be 0 or be equal to m_io_num");
std::cout << "[ INFO ] Offsets\n";
for (size_t i = 0; i < m_io_num; ++i) {
// offsets represent distance between consecutive elements of corresponding dimension.
// If a dim size == 1, then the next dim starts immediately and the stride is 0
Expand All @@ -282,7 +281,6 @@ void RuntimeConfigurator::update_data_offsets(const std::vector<VectorDims>& sha
const auto idx_stride = m_config->tensor_rank - shape.size();
compute_offsets(shape, offsets, m_config->tensor_rank, m_io_data_sizes[i], idx_stride);

std::cout << "\t offsets[" << i << "] = " << ov::PartialShape(offsets) << std::endl;
const auto& layout = layouts[i];
if (!layout.empty()) {
std::vector<size_t> reordered_offsets(offsets.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void CPURuntimeConfigurator::update_requested_descs(const ov::snippets::lowered:
const bool brgemm_with_extracted_repacking =
std::any_of(consumers.begin(), consumers.end(), [](const ov::snippets::lowered::ExpressionPort& port) {
auto brgemm = ov::as_type_ptr<ov::intel_cpu::BrgemmCPU>(port.get_expr()->get_node());
return brgemm && brgemm_utils::with_repacking(brgemm->get_type());
return port.get_index() == 1 && brgemm && brgemm_utils::with_repacking(brgemm->get_type());
});
if (brgemm_with_extracted_repacking) {
const auto& desc = param->get_output_port_descriptor(0);
Expand Down Expand Up @@ -183,15 +183,9 @@ void CPURuntimeConfigurator::adjust_offsets_from_descs(const ov::snippets::lower
const auto& blocked_shape = optimal_desc->as<DnnlBlockedMemoryDesc>()->getBlockDims();

ov::snippets::VectorDims shape_for_offset(m_config->tensor_rank - original_shape.size(), 1);
// Parallel work amount is copied from original shape
shape_for_offset.insert(shape_for_offset.end(), original_shape.begin(), original_shape.end() - m_config->tile_rank);
// Only first dim is batch, the rest are repacked KN
shape_for_offset.insert(shape_for_offset.end(), blocked_shape.begin() + 1, blocked_shape.end());
std::cout << "[ INFO ] shape_for_offset = " << ov::PartialShape(shape_for_offset) << std::endl;

shape_for_offset.insert(shape_for_offset.end(), blocked_shape.begin(), blocked_shape.end());
auto& offsets = m_config->io_data_offsets[i];
compute_offsets(shape_for_offset, offsets, shape_for_offset.size(), m_io_data_sizes[i], 0);
std::cout << "[ INFO ] offsets[*] = " << ov::PartialShape(offsets) << std::endl;
OPENVINO_ASSERT(ov::snippets::utils::is_planar_layout(parameter->get_output_port_descriptor(0)->get_layout()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ bool pass::AdjustBrgemmCopyBLoopPorts::run(const snippets::lowered::LinearIR& li
}
}
for (const auto& target_port : ports) {
std::cout << "[ INFO ] AdjustBrgemmCopyBLoopPorts works\n";
const auto &target_loop_ids = target_port.get_expr()->get_loop_ids();

// If loop ids match, it means there is no blocking loop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pass::MoveBrgemmRepackingOut::MoveBrgemmRepackingOut() {
if (!ov::snippets::utils::is_planar_layout(layout) || copy_b_node->get_output_size() != 1 ||
transformation_callback(copy_b_node))
return false;
std::cout << "[ INFO ] MoveBrgemmRepackingOut is finished\n";
return ov::replace_output_update_name(copy_b_out, copy_b_in);
};

Expand Down

0 comments on commit f45c4fa

Please sign in to comment.