diff --git a/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/opt.cpp b/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/opt.cpp index 3470739c848dac..118f0e7517b46a 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/opt.cpp +++ b/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/opt.cpp @@ -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(); + auto matched_node_param2_out = 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(); @@ -1536,10 +1537,10 @@ ConvToMatmul::ConvToMatmul(Context::Ref ctx) { auto new_reshape2 = std::make_shared(matched_node_param2, new_const2, false); // Connect to Reshape - if (ov::op::util::is_parameter(matched_node_param2)) { + if (matched_node_param2_out == matched_node_multiply) { matched_node_multiply->input(1).replace_source_output(new_reshape2); matched_node_multiply->validate_and_infer_types(); - } else { // constant -> convert -> multiply + } else { 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();