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

[Tests] Fix failing 8bit test #25564

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

younesbelkada
Copy link
Contributor

What does this PR do?

Fixes two failing tests in https://github.com/huggingface/transformers/actions/runs/5873964880/job/15928072870

  • tests/quantization/bnb/test_mixed_int8.py::MixedInt8Test::test_get_keys_to_not_convert & tests/quantization/bnb/test_mixed_int8.py::MixedInt8GPT2Test::test_get_keys_to_not_convert

Context: #25105 added stronger checks to enable the correct quantization of models on the Hub. Therefore it added a test that checks if mpt-7b is correctly quantized. Since that model requires einops to be added as a dependency I propose to simply add einops in the docker image

cc @ydshieh

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 17, 2023

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

@ydshieh
Copy link
Collaborator

ydshieh commented Aug 17, 2023

Hi @younesbelkada ! Could you tell a bit more why MPT needs einops?

@ydshieh
Copy link
Collaborator

ydshieh commented Aug 17, 2023

Also you probably need refresh your CircleCI token?

@younesbelkada
Copy link
Contributor Author

younesbelkada commented Aug 17, 2023

for MPT as you can see from the remote model, einops is used in files that are imported in modeling_mpt.py such as attention.py here: https://huggingface.co/mosaicml/mpt-7b/blob/main/attention.py#L7 it seems to be a strong dependency (hence the error on the slow test attached)
It is also listed as a dependency in the requirements file together with their custom fork of triton: https://huggingface.co/mosaicml/mpt-7b/blob/main/requirements.txt#L2 but the triton dependency is optional

@ydshieh
Copy link
Collaborator

ydshieh commented Aug 17, 2023

OK, I think I got confused by the fact we have a modeling file and we also use the same checkpoint name in our model tests. Now I get it, but a question: why we want to use the remote code rather than the code in transformers for this quantization test ..? Is it really necessary to use the remote code the quantization?

@younesbelkada
Copy link
Contributor Author

Thanks!
Regarding your question, yes I think so, #25105 added the support for correct quantization for most remote code models, therefore it is crucial to test the remote code model + non remote model in the test

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Thanks for explaining. Let's try it!

I am not sure what's the original purpose of testing the modeling code on the Hub - although we pin a revision, the code might change on the Hub, and our tests won't detect any failure if any for new code.

But as it is already there, let's keep it - just not to add any more remote model into the relevant tests 🙏

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.

Quite aligned with @ydshieh here. Don't think we should be testing a code on the hub with trust_remote_code. Why not use the model now that it is on transformers?
EDIT: read the original PR, guess it's okay, no a big fan of testing remote codes 😅

@younesbelkada younesbelkada merged commit d4c0aa1 into huggingface:main Aug 17, 2023
3 checks passed
@younesbelkada younesbelkada deleted the fix-bnb-test-einops branch August 17, 2023 15:34
blbadger pushed a commit to blbadger/transformers that referenced this pull request Nov 8, 2023
* fix failing 8bit test

* trigger CI
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.

4 participants