Skip to content

[OpenVINO Quantizer] Fix Method To Get WC Config from OVQuantizer in OV Adapter#3782

Merged
AlexanderDokuchaev merged 7 commits intoopenvinotoolkit:developfrom
anzr299:an/ovquantizer/fix_adapter
Jan 13, 2026
Merged

[OpenVINO Quantizer] Fix Method To Get WC Config from OVQuantizer in OV Adapter#3782
AlexanderDokuchaev merged 7 commits intoopenvinotoolkit:developfrom
anzr299:an/ovquantizer/fix_adapter

Conversation

@anzr299
Copy link
Copy Markdown
Collaborator

@anzr299 anzr299 commented Dec 10, 2025

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

@anzr299 anzr299 requested a review from a team as a code owner December 10, 2025 09:03
@anzr299 anzr299 changed the title [OpenVINO Quantizer] Fix Method Call in OV Adapter [OpenVINO Quantizer] Fix Method To Get WC Config from OVQuantizer in OV Adapter Dec 10, 2025
@github-actions github-actions Bot added API Public API-impacting changes and removed experimental labels Dec 10, 2025
Comment thread src/nncf/experimental/torch/fx/quantization/quantizer/openvino_adapter.py Outdated
@github-actions github-actions Bot removed the API Public API-impacting changes label Dec 11, 2025
Copy link
Copy Markdown
Collaborator

@daniil-lyakhov daniil-lyakhov left a comment

Choose a reason for hiding this comment

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

Comment thread src/nncf/quantization/algorithms/weight_compression/algorithm.py Outdated
Comment thread src/nncf/experimental/torch/fx/quantization/quantizer/openvino_adapter.py Outdated
Comment thread src/nncf/quantization/algorithms/weight_compression/algorithm.py Outdated
Comment thread src/nncf/quantization/algorithms/weight_compression/algorithm.py Outdated
@daniil-lyakhov daniil-lyakhov marked this pull request as draft December 22, 2025 13:47
@anzr299 anzr299 marked this pull request as ready for review January 8, 2026 14:11
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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why was this not detected during testing?

Copy link
Copy Markdown
Collaborator Author

@anzr299 anzr299 Jan 13, 2026

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you share code of quantizer?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

def available_backends(self) -> list[BackendType]:
return [BackendType.OPENVINO, BackendType.TORCH, BackendType.TORCH_FX, BackendType.ONNX]

@property
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In what context will this be used?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This will be used by the quantizer to access WC algorithm's properties such as the mode, group size and so on

@AlexanderDokuchaev AlexanderDokuchaev merged commit 2c068c5 into openvinotoolkit:develop Jan 13, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants