We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aaa71d7 commit 343bfd5Copy full SHA for 343bfd5
bitsandbytes/cextension.py
@@ -298,7 +298,16 @@ def get_native_library() -> BNBNativeLibrary:
298
299
300
try:
301
- lib = get_native_library()
+ if hasattr(torch, "xpu") and torch.xpu.is_available():
302
+ if not (ipex_cpu or ipex_xpu):
303
+ logger.warning(
304
+ "Detected Intel XPU but no Intel Extension for PyTorch (IPEX) installed. "
305
+ "IPEX is recommended for Intel XPU support in bitsandbytes to get better performance. "
306
+ "Please check the installation doc to install `intel_extension_for_pytorch`. "
307
+ )
308
+ lib = ErrorHandlerMockBNBNativeLibrary("XPU does not need native library")
309
+ else:
310
+ lib = get_native_library()
311
except Exception as e:
312
error_msg = str(e)
313
if not (ipex_cpu or ipex_xpu):
0 commit comments