Skip to content

Commit

Permalink
Sanity check: Add check for lib being None
Browse files Browse the repository at this point in the history
  • Loading branch information
Titus-von-Koeller authored and akx committed Mar 13, 2024
1 parent 45cb063 commit ce2bf15
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bitsandbytes/diagnostics/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@


def sanity_check():
from bitsandbytes.cextension import lib

if lib is None:
print_dedented(
"""
Couldn't load the bitsandbytes library, likely due to missing binaries.
Please ensure bitsandbytes is properly installed.
For source installations, compile the binaries with `cmake -DCOMPUTE_BACKEND=cuda -S .`.
See the documentation for more details if needed.
Trying a simple check anyway, but this will likely fail...
"""
)

from bitsandbytes.optim import Adam

p = torch.nn.Parameter(torch.rand(10, 10).cuda())
Expand Down

0 comments on commit ce2bf15

Please sign in to comment.