-
Notifications
You must be signed in to change notification settings - Fork 246
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
[Torch][PTQ] Examples are updated for the new PTQ TORCH backend #2246
[Torch][PTQ] Examples are updated for the new PTQ TORCH backend #2246
Conversation
7ffdcf7
to
f921950
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #2246 +/- ##
===========================================
- Coverage 90.71% 85.92% -4.80%
===========================================
Files 485 485
Lines 43632 43679 +47
===========================================
- Hits 39582 37531 -2051
- Misses 4050 6148 +2098
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
What is the reason for the disconnectedness of the graph?
Ticket 124397 |
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.
LGTM
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.
Good job improving nncf examples 👍 Minor comments from my side
examples/post_training_quantization/torch/ssd300_vgg16/requirements.txt
Outdated
Show resolved
Hide resolved
a6bf44f
to
5c0ab0b
Compare
…ted_inference_graph
@@ -540,6 +540,7 @@ def _get_quantization_target_points( | |||
self._backend_entity.shapeof_metatypes, | |||
self._backend_entity.dropout_metatypes, | |||
self._backend_entity.read_variable_metatypes, | |||
nncf_graph_contains_constants=backend != BackendType.TORCH, |
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'd like to note that we introduce backend-specific logic into a common part of the PTQ, which does not fit with our approach. Do you agree with that @alexsu52, @AlexanderDokuchaev, @nikita-savelyevv?
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, I agree. @daniil-lyakhov Could you update filter_constant_nodes
pass for discontinuous graphs?
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.
Done, please check
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 tried implementation we discussed db0ad8d, but found a corner case that is breaking the pass:
Graph
Before pass:
Expected after pass:
Actual after pass:
That's because convolution node should be an input node to survive filtering, but we have no prior information yet that can help us to mark this convolution as an input node
87c8d95
to
db0ad8d
Compare
This reverts commit db0ad8d.
Torch precommit is failing due to problems in e00f6b7, ticket 124679 |
…vinotoolkit#2246) - Do not filter constant nodes for torch backend in the inference graph - Fix version in requarements.txt for examples of post_training_quantization - for ssd300_vgg16 is not available to use torch 2.1.0 (failed on export to onnx Unsupported: ONNX export of operator get_pool_ceil_padding, tracing is not supporting too) - Update metrics - Add to PTEngine convert inputs to model's device to sync behavior with `create_compress_model` - Mobilenet_v2 example converting PyTorch model to IR by tracing (without onnx). - nncf.quantize for PyTorch works with copy of the target model To make PTQ work properly with disconnected graphs (like in [example](https://github.com/openvinotoolkit/nncf/blob/develop/examples/post_training_quantization/torch/ssd300_vgg16/main.py)) 124417 test_examples build 128 --------- Co-authored-by: Alexander Dokuchaev <alexander.dokuchaev@intel.com>
### Changes Update accuracy drop reference value. ### Reason for changes In #2246 reference accuracy values for original and quantized models were updated, but the corresponding accuracy drop reference value was not updated. ### Related tickets 136123
Changes
create_compress_model
Reason for changes
To make PTQ work properly with disconnected graphs (like in example)
Related tickets
124417
Tests
test_examples build 128