-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[TF Quant Models] Prepares GroupConvolution weights #25641
Conversation
auto reshaped_input = reshape_node->clone_with_new_inputs( | ||
{limit_input, | ||
ov::op::v0::Constant::create(element::i64, {new_limit_shape.size()}, new_limit_shape)})); | ||
ov::op::v0::Constant::create(element::i64, {new_limit_shape.size()}, new_limit_shape)}); | ||
if (auto constant = ov::util::get_constant_from_source(reshaped_input)) { | ||
reshaped_input = constant; | ||
} | ||
renewed_inputs.push_back(reshaped_input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: can we use ov::op::util::clone_try_fold
instead to make the code a bit shorter? The same at L87 and at L60 in pull_transpose_through_fq.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do that, sure. The only difference is that clone_try_fold only works for single node folding and get_constant_from_source checks all the necessary no_folding rt info and could fold a chain of nodes. For now, I won't change the code in the PR, however, in case more feedback arises -- I'll clean it up.
if (pattern_map.count(convert_p)) { | ||
const auto& convert_node = pattern_map.at(convert_p).get_node_shared_ptr(); | ||
convert_node->input(0).replace_source_output(reshaped_input); | ||
convert_node->validate_and_infer_types(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am just wondering: why should we manually call node validation here? It is usually automatically done by Validate
pass, isn't it?
Upd. It seems like it is needed to keep a valid graph state during one GraphRewrite
pass. Am I right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you ARE right. Since we are in a single Graph Rewrite -- it is safer to keep the graph in validated state, so that all the matchers could assume rank and shape is accurate
Performance validation is triggered for this particular PR with IR cache generation and calibration. No code is expected to be pushed in the branch. Merging is postponed until PR is proven to be non-regressive. |
This PR will be closed in a week because of 2 weeks of no activity. |
This PR was closed because it has been stalled for 2 week with no activity. |
src/common/transformations/tests/common_optimizations/fq_reshape_fusion.cpp
Show resolved
Hide resolved
This PR will be closed in a week because of 2 weeks of no activity. |
This PR was closed because it has been stalled for 2 week with no activity. |
I could not get the results for this PR. I propose merging the change to master and seeing if regressions arise in the regular validation. |
…25641) ### Details: - *using register_new_node in the matches to allow for seamless matcher application for the FQ node* - *added optional Convert node, so that pattern would work on different quantized weights forms* ![image](https://github.com/user-attachments/assets/2d485f5b-7609-40ac-b798-16124a9a290a) ### Tickets: - *CVS-39818*
Details:
Tickets: