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

[NLLB-MoE] Fix NLLB MoE 4bit inference #27012

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

younesbelkada
Copy link
Contributor

What does this PR do?

Fixes: #26898

The hidden states gets silenty casted in unint8 leading to the error described in #26898

The check and self.fc2.weight.dtype != torch.int8 is not sufficient in order to cover 4bit models, for these models the weights are in uint8, hence adding an extra condition to cover 4bit models fixes the inference issue

cc @ArthurZucker

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 23, 2023

The documentation is not available anymore as the PR was closed or merged.

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.

Interesting! Thanks for the fix

@younesbelkada younesbelkada merged commit 244a53e into huggingface:main Oct 23, 2023
18 checks passed
@younesbelkada younesbelkada deleted the fix-nllb-moe branch October 23, 2023 12:54
@CAH9487
Copy link

CAH9487 commented Oct 23, 2023

Thanks!

staghado pushed a commit to staghado/transformers that referenced this pull request Oct 24, 2023
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants