Skip to content

Commit 343bfd5

Browse files
committed
update bnb log
Signed-off-by: jiqing-feng <[email protected]>
1 parent aaa71d7 commit 343bfd5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

bitsandbytes/cextension.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,16 @@ def get_native_library() -> BNBNativeLibrary:
298298

299299

300300
try:
301-
lib = get_native_library()
301+
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()
302311
except Exception as e:
303312
error_msg = str(e)
304313
if not (ipex_cpu or ipex_xpu):

0 commit comments

Comments
 (0)