[OpenVINO Quantizer] Fix Method To Get WC Config from OVQuantizer in OV Adapter#3782
Conversation
daniil-lyakhov
left a comment
There was a problem hiding this comment.
Please add a test, example tests: https://github.com/openvinotoolkit/nncf/blob/develop/tests/torch/test_serialization.py
| return self._quantizer.get_nncf_weight_compression_parameters(model, nncf_graph) | ||
|
|
||
| def get_weight_compression_config(self) -> dict[str, Any]: | ||
| return self._quantizer.weight_compression_configuration |
There was a problem hiding this comment.
Why was this not detected during testing?
There was a problem hiding this comment.
Before this PR it was a class variable in the quantizer. That was a bad design so we made it a seperate method inside the quantizer.
There was a problem hiding this comment.
Could you share code of quantizer?
There was a problem hiding this comment.
| def available_backends(self) -> list[BackendType]: | ||
| return [BackendType.OPENVINO, BackendType.TORCH, BackendType.TORCH_FX, BackendType.ONNX] | ||
|
|
||
| @property |
There was a problem hiding this comment.
In what context will this be used?
There was a problem hiding this comment.
This will be used by the quantizer to access WC algorithm's properties such as the mode, group size and so on
Changes
in openvino adapter, call the get method of OVQUantizer to obtain the weights compression config
Reason for changes
Openvino adapter called an internal dictionary to obtain WC algorithm's comrpession config directly. I believe this is a bad approach, instead I have created another method in OVQuantizer such that this can be called to obtain the internal weights compression algorithm's config