Skip to content
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

[Torch] INT4 weight compression #3014

Merged
merged 10 commits into from
Oct 28, 2024

Conversation

alexsu52
Copy link
Contributor

@alexsu52 alexsu52 commented Oct 15, 2024

Changes

  • Support INT4 weight compression in Torch and Torch.FX backends
  • Added INT4SymmetricWeightsDecompressor and INT4ASymmetricWeightsDecompressor

Reason for changes

Support INT4 weight model compression of PyTorch models in NNCF.

Related tickets

#3005

Tests

updated tests

@github-actions github-actions bot added NNCF PT Pull requests that updates NNCF PyTorch NNCF PTQ Pull requests that updates NNCF PTQ labels Oct 15, 2024
@alexsu52 alexsu52 force-pushed the as/int4_torch_fx branch 4 times, most recently from 7906fa8 to c1d9fd7 Compare October 18, 2024 07:36
@alexsu52 alexsu52 marked this pull request as ready for review October 18, 2024 08:57
@alexsu52 alexsu52 requested a review from a team as a code owner October 18, 2024 08:57
)

if backup_mode is not None:
raise AttributeError("TorchFX backend does not support backup_mode option.")
if ratio is not None and ratio != 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I can see, Torch and Torch FX have the same processing of parameters. Does it make sense to combine them in a single function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for this comment. Thanks for this comment. We are going to refactor it when the torch.fx backend will be ready to move out from experiments module.

cc' @daniil-lyakhov, @anzr299

nncf/torch/quantization/quantize_functions.py Show resolved Hide resolved
nncf/torch/quantization/quantize_functions.py Outdated Show resolved Hide resolved
nncf/torch/quantization/quantize_functions.py Outdated Show resolved Hide resolved
@alexsu52 alexsu52 merged commit ef9cdd2 into openvinotoolkit:develop Oct 28, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Freeze 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.

4 participants