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

fix load_in_int8 behaviour for large models #495

Merged
merged 2 commits into from
Dec 26, 2023

Conversation

eaidova
Copy link
Collaborator

@eaidova eaidova commented Dec 25, 2023

What does this PR do?

update load_in_int8 logic in from_pretrained for getting the following behavior:

if user specified explicitly load_in_int8=True - model weights will be compressed to int8 after conversion
if user specified explicitly load_in_int8=Flase - model weights will not be compressed
if user does not specify this argument, allow to decide based on model size

This behavior is also aligned with optimum-cli export for openvino

Also changed providing load_in_8bit argument in _from_pretrained method after _from_transformers for avoiding double weights compression during model loading

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@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.

@AlexKoff88
Copy link
Collaborator

thanks for fixing that

@AlexKoff88 AlexKoff88 merged commit 622f585 into huggingface:main Dec 26, 2023
16 of 20 checks passed
@eaidova eaidova deleted the ea/fix_load_in_int8 branch December 26, 2023 07:52
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