Skip to content

Commit 6a5a18a

Browse files
Titus-von-Koellerakx
authored andcommitted
Sanity check: Add check for lib being None
1 parent e2db55e commit 6a5a18a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bitsandbytes/diagnostics/main.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@
1313

1414

1515
def sanity_check():
16+
from bitsandbytes.cextension import lib
17+
18+
if lib is None:
19+
print_dedented(
20+
"""
21+
Couldn't load the bitsandbytes library, likely due to missing binaries.
22+
Please ensure bitsandbytes is properly installed.
23+
24+
For source installations, compile the binaries with `cmake -DCOMPUTE_BACKEND=cuda -S .`.
25+
See the documentation for more details if needed.
26+
27+
Trying a simple check anyway, but this will likely fail...
28+
"""
29+
)
30+
1631
from bitsandbytes.optim import Adam
1732

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

0 commit comments

Comments
 (0)