-
Notifications
You must be signed in to change notification settings - Fork 1k
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] skip bnb-related tests instead of failing on xpu #2860
Conversation
add one more test: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! cc @SunMarc
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ! Left a few comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
What does this PR do?
When running
pytest tests/test_accelerator.py
on XPU, there are 4 tests failed:The reason for all 4 tests is the same: all tests use
load_in_8bit=True
when loading the model withAutoModelForCausalLM.from_pretrained
, which will lead to thetorch.cuda.is_available()
check inhf_quantizer.validate_environment
, e.g.Since BNB doesn't support XPU and NPU yet, we should skip these tests rather than let them fail. I also checked the original PR #2343, which makes those tests device-agnostic. These 4 tests are overlooked because the author doesn't install bitsandbytes. But when users install the libraries for testing using
pip install -e ".[testing]"
, the bitsandbytes library will be installed. So we should change the test maker torequire_cuda
, instead of making them device-agnostic, at least before the time when XPU and NPU are supported in BNB.@muellerzr @SunMarc