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

[DO NOT MERGE] Hf quantizer refactor #28703

Closed
wants to merge 78 commits into from

Conversation

younesbelkada
Copy link
Contributor

What does this PR do?

Built on top of #26610 - this PR is just to see if I don't any surprising diff similar as in poedator#4

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@younesbelkada
Copy link
Contributor Author

Thanks @poedator for your comments and ideas - I think the way forward would be to extend the xxxQuantizer by adding new arguments in the corresponding quantization config object - e.g. quantize_mlp_only . I feel mixing different quantization approaches (your second point) might be a bit too much of an edge case but contributors can always create a new quantizer for it MixedQuantizer with a MixedQuantizationConfig.

younesbelkada and others added 5 commits January 26, 2024 15:10
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

🔥 Great work.
Modeling utils refactor looks really great. My last comments are more around how we handle kwargs and getting as simple as possible with the way we init the quantizer, whether or not we actually need a AutoQuantizationConfig vs just a AutoHfQuantizer but otherwise good to go! 🤗

src/transformers/modeling_utils.py Show resolved Hide resolved
src/transformers/modeling_utils.py Show resolved Hide resolved
src/transformers/quantizers/auto.py Outdated Show resolved Hide resolved
src/transformers/quantizers/auto.py Outdated Show resolved Hide resolved
src/transformers/quantizers/base.py Show resolved Hide resolved
src/transformers/quantizers/quantizer_awq.py Show resolved Hide resolved
younesbelkada and others added 3 commits January 26, 2024 19:19
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
@younesbelkada
Copy link
Contributor Author

I will merge the commits of this PR directly in #26610 to properly credit @poedator from his great work ! closing this - thanks @ArthurZucker for the review and offline discussions!

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.

5 participants