Skip to content

Commit b52cacf

Browse files
anadonMekkCyber
authored andcommitted
Fix removing "cpu" from frozenset in bitsandbytes.py to allow better ROCm support. (huggingface#36975)
* Fix removing "cpu" from frozenset in bitsandbytes.py to allow better ROCm support. Related to bitsandbytes-foundation/bitsandbytes#1573 and huggingface#36949 , this resolves a bug in allowing ROCm/HIP support in bitsandbytes. * Related to bitsandbytes-foundation/bitsandbytes#1573 and huggingface#36949 , this resolves a bug in the biteandbytes integration, allowing ROCm/HIP support in bitsandbytes. --------- Co-authored-by: Mohamed Mekkouri <93391238+MekkCyber@users.noreply.github.com>
1 parent ccbe465 commit b52cacf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/transformers/integrations/bitsandbytes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,9 @@ def _validate_bnb_multi_backend_availability(raise_exception):
496496
"You have Intel IPEX installed but if you're intending to use it for CPU, it might not have the right version. Be sure to double check that your PyTorch and IPEX installs are compatible."
497497
)
498498

499-
available_devices.discard("cpu") # Only Intel CPU is supported by BNB at the moment
499+
available_devices = frozenset(
500+
[device for device in available_devices if device != "cpu"]
501+
) # Only Intel CPU is supported by BNB at the moment
500502

501503
if not available_devices.intersection(bnb_supported_devices):
502504
if raise_exception:

0 commit comments

Comments
 (0)