Skip to content

[FX][AWQ][Scale Estimation][Mixed Precision] Add Data Aware Algorithm Support for FX Backend #3409

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

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

anzr299
Copy link
Collaborator

@anzr299 anzr299 commented Apr 7, 2025

Changes

The following algorithms were added for Torch FX backend:

  1. AWQ
  2. Scale Estimation
  3. Data-Aware Mixed Precision

Tests

TemplateWeightCompression was extended for torch FX backend for the above algorithms in tests/torch/fx/test_compress_weights.py

@anzr299 anzr299 requested a review from a team as a code owner April 7, 2025 14:41
@github-actions github-actions bot added NNCF PT Pull requests that updates NNCF PyTorch NNCF PTQ Pull requests that updates NNCF PTQ labels Apr 7, 2025
@MaximProshin
Copy link
Collaborator

@anzr299 , please share conformance test results for these methods

for node in next_nodes:
target_points.append(
PTTargetPoint(
PTWeightCompressionAlgoBackend.TARGET_TYPE_TO_PT_INS_TYPE_MAP[TargetType.PRE_LAYER_OPERATION],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please specify the actual target type without the dict?

Copy link
Collaborator Author

@anzr299 anzr299 Apr 11, 2025

Choose a reason for hiding this comment

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

Done, my reasoning behind this approach was that it will be less modular if we directly define it in case of changes to the target type in the future

Comment on lines +285 to +286
class FXMixedPrecisionAlgoBackend(MixedPrecisionAlgoBackend, FXWeightCompressionAlgoBackend):
@staticmethod
Copy link
Collaborator

@daniil-lyakhov daniil-lyakhov Apr 11, 2025

Choose a reason for hiding this comment

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

Do we have a plan on how to reuse the same classes across all the PyTorch backends? If not, could you please create a ticket for that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we can set a flag in a common backend class (such as FX=False) when initializing it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@anzr299, It would be great if you would open a ticket and implement a make a proposal which we could discuss with the team

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alright, I will do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NNCF PT Pull requests that updates NNCF PyTorch NNCF PTQ Pull requests that updates NNCF PTQ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants