Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NPUW] Extend ConvToMatmul pattern #27561

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,7 @@ ConvToMatmul::ConvToMatmul(Context::Ref ctx) {
auto matched_node_transpose_in = node_to_output.at(transpose_in).get_node_shared_ptr();
auto matched_node_transpose_out = node_to_output.at(transpose_out).get_node_shared_ptr();
auto matched_node_multiply = node_to_output.at(multiply).get_node_shared_ptr();
const auto& cvt2_or_multiply = uat::_(node_to_output).at_or_at(convert2, multiply);

const auto& shape = matched_node_param->get_shape();
const auto& shape2 = matched_node_param2->get_shape();
Expand Down Expand Up @@ -1536,10 +1537,10 @@ ConvToMatmul::ConvToMatmul(Context::Ref ctx) {
auto new_reshape2 = std::make_shared<ov::op::v1::Reshape>(matched_node_param2, new_const2, false);

// Connect to Reshape
if (ov::op::util::is_parameter(matched_node_param2)) {
if (cvt2_or_multiply == matched_node_multiply) { // param -> multiply
matched_node_multiply->input(1).replace_source_output(new_reshape2);
matched_node_multiply->validate_and_infer_types();
} else { // constant -> convert -> multiply
} else { // constant -> (convert) -> multiply
node_to_output.at(convert2).get_node_shared_ptr()->input(0).replace_source_output(new_reshape2);
node_to_output.at(convert2).get_node_shared_ptr()->validate_and_infer_types();
matched_node_multiply->validate_and_infer_types();
Expand Down
Loading