Skip to content

Conversation

Aryanpagaria
Copy link

###Summary

This PR refactors duplicated logic for weight compression handling across different backends.
The is_weight_compression_needed function and the BackendParameters class were previously defined in multiple backend-specific files (FX and OpenVINO).
Since the logic is identical, they have now been consolidated into a single shared module for better code reuse and maintainability.

###Changes Made

Moved common logic to a new file:
src/nncf/common/quantization/backend_parameters.py

Removed backend-specific duplicates:

src/nncf/experimental/torch/fx/quantization/backend_parameters.py

src/nncf/openvino/quantization/backend_parameters.py

Updated import statements in affected modules to reference the new common file.

No logic changes — purely a structural refactor.

###Reason for Change

Having identical logic across multiple backend implementations caused unnecessary duplication and made maintenance harder.
This refactor improves:

Code consistency

Readability

Ease of future modifications

###Testing

Ran full pytest suite — all tests passed successfully.

Verified that all backend compression logic functions as expected using the common implementation.

###Related Issue

Fixes: #3668

@Aryanpagaria Aryanpagaria requested a review from a team as a code owner October 21, 2025 11:32
@ljaljushkin
Copy link
Contributor

@Aryanpagaria thank you for the contribution!
Unfortunately, the #3668 issue was assigned to @aobolensk and there's a PR waiting for review: #3669
@daniil-lyakhov, will #3669 be merged?

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.

[Good First Issue][NNCF]: Move is_weight_compression_needed function to common

2 participants