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

POC: special case of removing uneffective zeropoint Subtract OP #27943

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

esmirno
Copy link
Contributor

@esmirno esmirno commented Dec 5, 2024

Details:

  • item1
  • ...

Tickets:

  • ticket-id

@github-actions github-actions bot added category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin labels Dec 5, 2024

//TODO: verify input 0 is subtract
multiply_node->input(0).replace_source_output(sub_weights_node->output(0));
multiply_node->validate_and_infer_types();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is probably not required

auto sub_weights_node = node_to_output.at(sub_weights).get_node_shared_ptr();

//TODO: verify input 0 is subtract
multiply_node->input(0).replace_source_output(sub_weights_node->output(0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

->input(0) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

->input(0) seems ok - i think i've tried both cases, sub_weights_node and sub_weights_node->output(0), as well. Will check one more time.

LOG_DEBUG("UneffectiveZP subgraph detected with NOP zp tensor: "
<< zero_point_tensor_node->get_friendly_name() << " shape=" << zero_point_tensor_node->get_shape());
// removing whole zubgraph with subtract + zeropoints
auto multiply_node = node_to_output.at(subtract).get_node_shared_ptr();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmatveev looks here was a typo - subtract instead of multiply

+bathless params dims produced by partitioner while replacing const by params, by squeesing uneffective dims, and the inserting reshape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants