-
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
Generalization the weight compression algorithm to PyTorch model. #2333
Generalization the weight compression algorithm to PyTorch model. #2333
Conversation
d6e8c73
to
85f3afb
Compare
nncf/quantization/algorithms/weight_compression/openvino_backend.py
Outdated
Show resolved
Hide resolved
1b1e4fa
to
6302489
Compare
6302489
to
6532240
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #2333 +/- ##
===========================================
- Coverage 90.09% 81.94% -8.16%
===========================================
Files 492 497 +5
Lines 45331 44974 -357
===========================================
- Hits 40843 36852 -3991
- Misses 4488 8122 +3634
... and 57 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
91da031
to
95aea75
Compare
95aea75
to
9f0654d
Compare
if edge.input_port_id == weight_port_id: | ||
weight_node = prev_node |
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.
Is it possible to get specific edge by index instead of a search through all ancestors?
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 think this is possible, but I did not find such API in the NNCFGraph. It looks like we need to think about it.
nncf/quantization/algorithms/weight_compression/torch_backend.py
Outdated
Show resolved
Hide resolved
nncf/quantization/algorithms/weight_compression/torch_backend.py
Outdated
Show resolved
Hide resolved
nncf/quantization/algorithms/weight_compression/weight_lowering.py
Outdated
Show resolved
Hide resolved
nncf/quantization/algorithms/weight_compression/weight_lowering.py
Outdated
Show resolved
Hide resolved
333439d
to
d7cc206
Compare
from nncf.quantization.algorithms.weight_compression.config import WeightCompressionConfig | ||
from nncf.quantization.algorithms.weight_compression.mixed_precision import MIXED_PRECISION_CRITERIA | ||
from nncf.quantization.algorithms.weight_compression.weight_lowering import get_integer_quantization_error |
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.
FYI
I made a ticket to make a template tests for weights compression algorithm to reuse references and tests No 129446
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.
Thanks, good suggestion!
Calculated the perplexity on wikitext with the proposed changes and before them.
I use the same version of OpenVINO |
"group_size": self._group_size, | ||
"ratio": self._ratio, | ||
"all_layers": self._all_layers, | ||
"ignored_scope": self._ignored_scope, |
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.
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.
Thanks for your suggestion. This behavior corresponds to ignore-scoped methods such as nncf.quantize(). I think this needs to be changed for all methods with ignored scope at once. Please open a ticket to take action on your suggestion.
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.
opened ticket 129593
I'm guessing the following code made the changes
and
I would note that I did not change references in the tests. |
cf71969
to
1e0cd8a
Compare
Yes, after commenting lines with casting scale and zp, the perplexity become the same. |
34ce756
to
7dbf702
Compare
) cherry pick to release #2333
Changes
Main changes:
WeightsDecompressor
module in the Torch backenddecompress
compression operator in the Torch backendRelated changes:
Reason for changes
Related tickets
ref: 119585
Tests
test_tensors