bitsandbytes icon indicating copy to clipboard operation
bitsandbytes copied to clipboard

Everything seems a real mess

Open nextdimension opened this issue 3 years ago • 31 comments

I'm using linux and I have installed version 0.37 from pip and it is not compiled with gpu support. I tried every version of b&b and combination of cuda versions and I either get not compiled with gpu support error or AttributeError: module 'bitsandbytes.nn' has no attribute 'Linear8bitLt'

I can also find no version specifically compiled for cuda 12.0 or 11.8 but they are mentioned as having better cuda detection in the 0.37 release notes.

At this point I give up. Why is the versioning and compiled versions such a mess?

nextdimension avatar Mar 08 '23 17:03 nextdimension

Can you please post the output of python -m bitsandbytes. This will help me to debug.

TimDettmers avatar Mar 08 '23 22:03 TimDettmers

Might've just installed the og repo because you're in a docker image that's a bit out of date. Also, I'd try to avoid 12.0 for a few more months (weeks?), even though I'm sure NVIDIA would love for you to switch yesterday. Have you tried compiling+installing from this repo, specifically? Ignore pip for a moment.

calhounpaul avatar Mar 08 '23 22:03 calhounpaul

Can you please post the output of python -m bitsandbytes. This will help me to debug.

I'm getting the same issue the output of python -m bitsandbytes is the following: Traceback (most recent call last): File "/home/yes/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/yes/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/yes/anaconda3/lib/python3.9/site-packages/bitsandbytes/main.py", line 30, in from . import COMPILED_WITH_CUDA, PACKAGE_GITHUB_URL ImportError: cannot import name 'COMPILED_WITH_CUDA' from 'bitsandbytes' (/home/yes/anaconda3/lib/python3.9/site-packages/bitsandbytes/init.py)

I'm not sure what needs to be updated but I'm just trying to run alpaca-lora-30b-int4 and running into a ton of issue. Any help would be appreciated.

scotter1995 avatar Mar 27 '23 01:03 scotter1995

I have the same situation on linux, I installed using pip install bitsandbytes-cuda117 and python -m bitsandbytes yields :

==============================WARNING: DEPRECATED!==============================
WARNING! This version of bitsandbytes is deprecated. Please switch to `pip install bitsandbytes` and the new repo: https://github.com/TimDettmers/bitsandbytes
==============================WARNING: DEPRECATED!==============================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++ DEBUG INFORMATION +++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Traceback (most recent call last):
  File "/home/jp/miniconda3/envs/lora/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/jp/miniconda3/envs/lora/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/jp/miniconda3/envs/lora/lib/python3.9/site-packages/bitsandbytes/__main__.py", line 30, in <module>
    from . import COMPILED_WITH_CUDA, PACKAGE_GITHUB_URL
ImportError: cannot import name 'COMPILED_WITH_CUDA' from 'bitsandbytes' (/home/jp/miniconda3/envs/lora/lib/python3.9/site-packages/bitsandbytes/__init__.py)

jprobichaud avatar Mar 31 '23 21:03 jprobichaud

same issue, not just linux, Wndows too. PS C:\Users\PC\Downloads\AI\LLM\gpt4all\nomic> python -m bitsandbytes ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++ DEBUG INFORMATION +++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\Users\PC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\bitsandbytes_main.py", line 30, in from . import COMPILED_WITH_CUDA, PACKAGE_GITHUB_URL ImportError: cannot import name 'COMPILED_WITH_CUDA' from 'bitsandbytes' (unknown location) PS C:\Users\PC\Downloads\AI\LLM\gpt4all\nomic> $

jsoyee avatar Apr 02 '23 23:04 jsoyee

I having this issue too. Just ran python -m bitsandbytes this is what I got:

===================================BUG REPORT=================================== Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues

CUDA SETUP: CUDA runtime path found: /home/gomesd/miniconda3/envs/alpaca3/lib/libcudart.so CUDA SETUP: Highest compute capability among GPUs detected: 7.0 CUDA SETUP: Detected CUDA version 117 /home/gomesd/miniconda3/envs/alpaca3/lib/python3.9/site-packages/bitsandbytes/cuda_setup/main.py:136: UserWarning: WARNING: Compute capability < 7.5 detected! Only slow 8-bit matmul is supported for your GPU! warn(msg) CUDA SETUP: Required library version not found: libbitsandbytes_cuda117_nocublaslt.so. Maybe you need to compile it from source? CUDA SETUP: Defaulting to libbitsandbytes_cpu.so...

================================================ERROR===================================== CUDA SETUP: CUDA detection failed! Possible reasons:

  1. CUDA driver not installed
  2. CUDA not installed
  3. You have multiple conflicting CUDA libraries
  4. Required library not pre-compiled for this bitsandbytes release! CUDA SETUP: If you compiled from source, try again with make CUDA_VERSION=DETECTED_CUDA_VERSION for example, make CUDA_VERSION=113. CUDA SETUP: The CUDA version for the compile might depend on your conda install. Inspect CUDA version via conda list | grep cuda. ================================================================================

CUDA SETUP: Something unexpected happened. Please compile from source: git clone [email protected]:TimDettmers/bitsandbytes.git cd bitsandbytes CUDA_VERSION=117 make cuda11x_nomatmul python setup.py install CUDA SETUP: CUDA runtime path found: /home/gomesd/miniconda3/envs/alpaca3/lib/libcudart.so CUDA SETUP: Highest compute capability among GPUs detected: 7.0 CUDA SETUP: Detected CUDA version 117 CUDA SETUP: Required library version not found: libbitsandbytes_cuda117_nocublaslt.so. Maybe you need to compile it from source? CUDA SETUP: Defaulting to libbitsandbytes_cpu.so...

================================================ERROR===================================== CUDA SETUP: CUDA detection failed! Possible reasons:

  1. CUDA driver not installed
  2. CUDA not installed
  3. You have multiple conflicting CUDA libraries
  4. Required library not pre-compiled for this bitsandbytes release! CUDA SETUP: If you compiled from source, try again with make CUDA_VERSION=DETECTED_CUDA_VERSION for example, make CUDA_VERSION=113. CUDA SETUP: The CUDA version for the compile might depend on your conda install. Inspect CUDA version via conda list | grep cuda. ================================================================================

CUDA SETUP: Something unexpected happened. Please compile from source: git clone [email protected]:TimDettmers/bitsandbytes.git cd bitsandbytes CUDA_VERSION=117 make cuda11x_nomatmul python setup.py install CUDA SETUP: Setup Failed! CUDA SETUP: CUDA runtime path found: /home/gomesd/miniconda3/envs/alpaca3/lib/libcudart.so CUDA SETUP: Highest compute capability among GPUs detected: 7.0 CUDA SETUP: Detected CUDA version 117 CUDA SETUP: Required library version not found: libbitsandbytes_cuda117_nocublaslt.so. Maybe you need to compile it from source? CUDA SETUP: Defaulting to libbitsandbytes_cpu.so...

================================================ERROR===================================== CUDA SETUP: CUDA detection failed! Possible reasons:

  1. CUDA driver not installed
  2. CUDA not installed
  3. You have multiple conflicting CUDA libraries
  4. Required library not pre-compiled for this bitsandbytes release! CUDA SETUP: If you compiled from source, try again with make CUDA_VERSION=DETECTED_CUDA_VERSION for example, make CUDA_VERSION=113. CUDA SETUP: The CUDA version for the compile might depend on your conda install. Inspect CUDA version via conda list | grep cuda. ================================================================================

CUDA SETUP: Something unexpected happened. Please compile from source: git clone [email protected]:TimDettmers/bitsandbytes.git cd bitsandbytes CUDA_VERSION=117 make cuda11x_nomatmul python setup.py install CUDA SETUP: Setup Failed! CUDA SETUP: CUDA runtime path found: /home/gomesd/miniconda3/envs/alpaca3/lib/libcudart.so CUDA SETUP: Highest compute capability among GPUs detected: 7.0 CUDA SETUP: Detected CUDA version 117 CUDA SETUP: Required library version not found: libbitsandbytes_cuda117_nocublaslt.so. Maybe you need to compile it from source? CUDA SETUP: Defaulting to libbitsandbytes_cpu.so...

================================================ERROR===================================== CUDA SETUP: CUDA detection failed! Possible reasons:

  1. CUDA driver not installed
  2. CUDA not installed
  3. You have multiple conflicting CUDA libraries
  4. Required library not pre-compiled for this bitsandbytes release! CUDA SETUP: If you compiled from source, try again with make CUDA_VERSION=DETECTED_CUDA_VERSION for example, make CUDA_VERSION=113. CUDA SETUP: The CUDA version for the compile might depend on your conda install. Inspect CUDA version via conda list | grep cuda. ================================================================================

CUDA SETUP: Something unexpected happened. Please compile from source: git clone [email protected]:TimDettmers/bitsandbytes.git cd bitsandbytes CUDA_VERSION=117 make cuda11x_nomatmul python setup.py install CUDA SETUP: Setup Failed! CUDA SETUP: Something unexpected happened. Please compile from source: git clone [email protected]:TimDettmers/bitsandbytes.git cd bitsandbytes CUDA_VERSION=117 make cuda11x_nomatmul python setup.py install Traceback (most recent call last): File "/home/gomesd/miniconda3/envs/alpaca3/lib/python3.9/runpy.py", line 188, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/home/gomesd/miniconda3/envs/alpaca3/lib/python3.9/runpy.py", line 147, in _get_module_details return _get_module_details(pkg_main_name, error) File "/home/gomesd/miniconda3/envs/alpaca3/lib/python3.9/runpy.py", line 111, in _get_module_details import(pkg_name) File "/home/gomesd/miniconda3/envs/alpaca3/lib/python3.9/site-packages/bitsandbytes/init.py", line 7, in from .autograd._functions import ( File "/home/gomesd/miniconda3/envs/alpaca3/lib/python3.9/site-packages/bitsandbytes/autograd/init.py", line 1, in from ._functions import undo_layout, get_inverse_transform_indices File "/home/gomesd/miniconda3/envs/alpaca3/lib/python3.9/site-packages/bitsandbytes/autograd/_functions.py", line 9, in import bitsandbytes.functional as F File "/home/gomesd/miniconda3/envs/alpaca3/lib/python3.9/site-packages/bitsandbytes/functional.py", line 17, in from .cextension import COMPILED_WITH_CUDA, lib File "/home/gomesd/miniconda3/envs/alpaca3/lib/python3.9/site-packages/bitsandbytes/cextension.py", line 22, in raise RuntimeError(''' RuntimeError: CUDA Setup failed despite GPU being available. Inspect the CUDA SETUP outputs above to fix your environment! If you cannot find any issues and suspect a bug, please open an issue with detals about your environment: https://github.com/TimDettmers/bitsandbytes/issues

dlcvag avatar Apr 03 '23 18:04 dlcvag

Any updates on this issue please?

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++ DEBUG INFORMATION +++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "../python3.11/site-packages/bitsandbytes/main.py", line 30, in from . import COMPILED_WITH_CUDA, PACKAGE_GITHUB_URL ImportError: cannot import name 'COMPILED_WITH_CUDA' from 'bitsandbytes' (unknown location) (m

BayramAnnakov avatar Apr 06 '23 06:04 BayramAnnakov

Any updates. Please help!

AttributeError: module 'bitsandbytes.nn' has no attribute 'Linear8bitLt'

samarthsarin avatar Apr 06 '23 11:04 samarthsarin

I managed to get go forward with pip install bitsandbytes and installing the cudatoolkit package with conda.

On Thu, Apr 6, 2023, 7:37 a.m. samarthsarin @.***> wrote:

Any updates. Please help!

— Reply to this email directly, view it on GitHub https://github.com/TimDettmers/bitsandbytes/issues/185#issuecomment-1498926860, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACGTL26TWWLHZDT22MP6M63W72TJFANCNFSM6AAAAAAVUCMWSA . You are receiving this because you commented.Message ID: @.***>

jprobichaud avatar Apr 06 '23 15:04 jprobichaud

I too get the error after installing cudatoolkit.

sjhyeon2 avatar Apr 07 '23 06:04 sjhyeon2

This worked for me:

pip uninstall bitsandbytes
pip install bitsandbytes

Thireus avatar Apr 07 '23 07:04 Thireus

I have the same issue

donote avatar Apr 13 '23 08:04 donote

I am also faced with this issue:

AttributeError: module 'bitsandbytes.nn' has no attribute 'Linear8bitLt'

Using:

WSL
11.8 Toolkit (nvcc -V)
pip install bitsandbytes

afogarty85 avatar May 05 '23 02:05 afogarty85

I have the same issue

I have resolved this problem. see the issue: https://github.com/TimDettmers/bitsandbytes/issues/305#issuecomment-1507841745

donote avatar May 06 '23 08:05 donote

I have the same issue

I have resolved this problem.

see the issue: https://github.com/TimDettmers/bitsandbytes/issues/305#issuecomment-1507841745

No you haven't. The issue still persists.

Reinstalling cuda may have worked for you but you assume people are using conda, I am not.

I have worked around this issue but it still happens.

One of the problems is that the library does not look in all the right file paths for cuda, specifically on arch it looks on the wrong place.

So you need to set the environment variable to point to the right cuda path.

Super annoying, as the error messages are miss leading.

nextdimension avatar May 06 '23 08:05 nextdimension

Any updates. Please help!

AttributeError: module 'bitsandbytes.nn' has no attribute 'Linear8bitLt'

I'm also facing the same issue. Any fix?

chintan-donda avatar May 16 '23 11:05 chintan-donda

Any updates. Please help! AttributeError: module 'bitsandbytes.nn' has no attribute 'Linear8bitLt'

I'm also facing the same issue. Any fix?

Uninstall bitsandbytes and compile it from scratch (might be a bit elaborate, depending on your setup). This solved it for me though.

smokey42 avatar May 20 '23 19:05 smokey42

i am having the same issue after pip install bitsandbytes-cu117.

but perhaps @TimDettmers is not the one (at all) to blame for this "mess" :| various OS, cuda versions, hardwares.

keunwoochoi avatar Jun 01 '23 23:06 keunwoochoi

Same issue here, tried everything you can imagine including compiling bitsandbytes from here, following your instructions. Cuda 117, WSL... Textgen UI complains it's not compiled with CUDA... Or it fails with attribute error (no linear8bit bla bla bla....

AttributeError: module 'bitsandbytes.nn' has no attribute 'Linear8bitLt'

bczreasons avatar Jun 03 '23 16:06 bczreasons

Doing a wipe of nvidia-* and reinstalling fixed the issue for me. The below documentation is for WSL Linux but it should also work for most other distros; consider the following steps:

https://github.com/afogarty85/AzureDataEngineering-DeepLearning/blob/main/DeepLearning/LinuxCUDASetup.sh

afogarty85 avatar Jun 03 '23 17:06 afogarty85