"src/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "11631e815416433256d7c5953b4effa4eae64d6d"
Commit ebfda251 authored by Titus von Koeller's avatar Titus von Koeller
Browse files

cleanup python -m bnb to align with changes

parent f1d9d80a
...@@ -13,21 +13,6 @@ from bitsandbytes.diagnostics.utils import print_dedented, print_header ...@@ -13,21 +13,6 @@ from bitsandbytes.diagnostics.utils import print_dedented, print_header
def sanity_check(): 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 from bitsandbytes.optim import Adam
p = torch.nn.Parameter(torch.rand(10, 10).cuda()) p = torch.nn.Parameter(torch.rand(10, 10).cuda())
...@@ -67,12 +52,15 @@ def main(): ...@@ -67,12 +52,15 @@ def main():
print("SUCCESS!") print("SUCCESS!")
print("Installation was successful!") print("Installation was successful!")
return return
except ImportError: except RuntimeError as e:
print( if "not available in CPU-only" in str(e):
f"WARNING: {__package__} is currently running as CPU-only!\n" print(
"Therefore, 8-bit optimizers and GPU quantization are unavailable.\n\n" f"WARNING: {__package__} is currently running as CPU-only!\n"
f"If you think that this is so erroneously,\nplease report an issue!", "Therefore, 8-bit optimizers and GPU quantization are unavailable.\n\n"
) f"If you think that this is so erroneously,\nplease report an issue!",
)
else:
raise e
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()
print_dedented( print_dedented(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment