Skip to content

update bnb log #1661

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

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion bitsandbytes/cextension.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,16 @@ def get_native_library() -> BNBNativeLibrary:


try:
lib = get_native_library()
if hasattr(torch, "xpu") and torch.xpu.is_available():
if not (ipex_cpu or ipex_xpu):
logger.warning(
"Detected Intel XPU but no Intel Extension for PyTorch (IPEX) installed. "
"IPEX is recommended for Intel XPU support in bitsandbytes to get better performance. "
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please mention Triton here?
For example: "XPU is detected, but IPEX is missing, will try to use Trtiton implementation. If performance is lower your expectations, consider installing IPEX"

The current wording effectively prohibits the use of XPU without IPEX.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

"Please check the installation doc to install `intel_extension_for_pytorch`. "
)
lib = ErrorHandlerMockBNBNativeLibrary("XPU does not need native library")

Choose a reason for hiding this comment

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

why need ErrorHandlerMockBNBNativeLibrary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought it was the default lib, but we can just set lib=None since XPU will not use lib.

else:
lib = get_native_library()
except Exception as e:
error_msg = str(e)
if not (ipex_cpu or ipex_xpu):
Expand Down