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 bnb cpu error #3351

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

faaany
Copy link
Contributor

@faaany faaany commented Jan 17, 2025

What does this PR do?

Follow up on PR #3350.

The reason for the failure is that is_bitsandbytes_multi_backend_available() returns True on XPU, but False on CUDA. And this is because CUDA and XPU have different ways to install bitsandbytes (see here).

To align the behavior on CUDA and XPU, we need to add an XPU check, thus this PR.

cc @muellerzr @SunMarc

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

@faaany faaany marked this pull request as ready for review February 5, 2025 01:21
Comment on lines +1474 to +1478
if (
("cpu" in model_devices and not is_bitsandbytes_multi_backend_available())
or ("cpu" in model_devices and is_xpu_available())
or "disk" in model_devices
):
Copy link
Member

Choose a reason for hiding this comment

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

does this mean that with xpu, it doesn't work if the model in on cpu even if bnb multi-backend is installed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, cpu and xpu share the same bnb installation method, namely the multi-backend support.

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