issue with quantization on windows

#46
by FantasticMrCat - opened

I am currently geting the following bug. I beleave this is because bitsandbytes only works on linux. is there a way i can run this on windows. if so how and what is the code?


===================================BUG REPORT===================================
C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\cuda_setup\main.py:166: UserWarning: Welcome to bitsandbytes. For bug reports, please run

python -m bitsandbytes


  warn(msg)
================================================================================
The following directories listed in your path were found to be non-existent: {WindowsPath('C')}
C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\cuda_setup\main.py:166: UserWarning: C:\Users\henso\anaconda3 did not contain ['libcudart.so', 'libcudart.so.11.0', 'libcudart.so.12.0'] as expected! Searching further paths...
  warn(msg)
The following directories listed in your path were found to be non-existent: {WindowsPath('AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAABKa/Ud0p/kKIDk52UkSDsAQAAAACAAAAAAAQZgAAAAEAACAAAADgZx/y2yxMKW0LfnC5+pz0gZVDk3/ZhsOECiA1qk1faQAAAAAOgAAAAAIAACAAAABeotZcMR4+a/nMEepdn2C7xeSXoOj9Hz0xQf1b6e1DHmAAAAD6h3xlf63b0R6p1gcVpQCMJbjuq6q/oGxIWIYIwrX/4fDiyQaOWbIDbCcmJ3gAVquAC11TPpTgoGh0TcSjKY+Wd3n8bQH4/AxWCphTLA/ijV4S4Ylut0lBbfVd/jjbiSpAAAAALHQUFVJPs6SKGSpNXoq22eBBtQrz7zpi6Y+G9vpBXG4U0AFPOGVJk5CrJRKHZhFW5qMo6BaCHJqbapw63a79oQ==')}
CUDA_SETUP: WARNING! libcudart.so not found in any environmental path. Searching in backup paths...
The following directories listed in your path were found to be non-existent: {WindowsPath('/usr/local/cuda/lib64')}
DEBUG: Possible options found for libcudart.so: set()
CUDA SETUP: PyTorch settings found: CUDA_VERSION=118, Highest Compute Capability: 8.9.
CUDA SETUP: To manually override the PyTorch CUDA version please see:https://github.com/TimDettmers/bitsandbytes/blob/main/how_to_use_nonpytorch_cuda.md
CUDA SETUP: Loading binary C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\libbitsandbytes_cuda118.so...
argument of type 'WindowsPath' is not iterable
CUDA SETUP: Problem: The main issue seems to be that the main CUDA runtime library was not detected.
CUDA SETUP: Solution 1: To solve the issue the libcudart.so location needs to be added to the LD_LIBRARY_PATH variable
CUDA SETUP: Solution 1a): Find the cuda runtime library via: find / -name libcudart.so 2>/dev/null
CUDA SETUP: Solution 1b): Once the library is found add it to the LD_LIBRARY_PATH: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:FOUND_PATH_FROM_1a
CUDA SETUP: Solution 1c): For a permanent solution add the export from 1b into your .bashrc file, located at ~/.bashrc
CUDA SETUP: Solution 2: If no library was found in step 1a) you need to install CUDA.
CUDA SETUP: Solution 2a): Download CUDA install script: wget https://github.com/TimDettmers/bitsandbytes/blob/main/cuda_install.sh
CUDA SETUP: Solution 2b): Install desired CUDA version to desired location. The syntax is bash cuda_install.sh CUDA_VERSION PATH_TO_INSTALL_INTO.
CUDA SETUP: Solution 2b): For example, "bash cuda_install.sh 113 ~/local/" will download CUDA 11.3 and install into the folder ~/local
Traceback (most recent call last):
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\utils\import_utils.py", line 1345, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\integrations\bitsandbytes.py", line 11, in <module>
    import bitsandbytes as bnb
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\__init__.py", line 6, in <module>
    from . import cuda_setup, utils, research
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\research\__init__.py", line 1, in <module>
    from . import nn
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\research\nn\__init__.py", line 1, in <module>
    from .modules import LinearFP8Mixed, LinearFP8Global
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\research\nn\modules.py", line 8, in <module>
    from bitsandbytes.optim import GlobalOptimManager
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\optim\__init__.py", line 6, in <module>
    from bitsandbytes.cextension import COMPILED_WITH_CUDA
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\bitsandbytes\cextension.py", line 20, in <module>
    raise RuntimeError('''
RuntimeError:
        CUDA Setup failed despite GPU being available. Please run the following command to get more information:

        python -m bitsandbytes

        Inspect the output of the command and see if you can locate CUDA libraries. You might need to add them
        to your LD_LIBRARY_PATH. If you suspect a bug, please take the information from python -m bitsandbytes
        and open an issue at: https://github.com/TimDettmers/bitsandbytes/issues

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "c:\AI\AAA-AI-PROJECT\fuyu-8b-test\fuyu-2\fuyu-8b\test.py", line 16, in <module>
    model = FuyuForCausalLM.from_pretrained(model_id, quantization_config=quantization_config, device_map="cuda:0", torch_dtype=torch.float16)
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\modeling_utils.py", line 3250, in from_pretrained
    from .integrations import get_keys_to_not_convert, replace_with_bnb_linear
  File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\utils\import_utils.py", line 1335, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "C:\Users\henso\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\utils\import_utils.py", line 1347, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import transformers.integrations.bitsandbytes because of the following error (look up to see its traceback):

        CUDA Setup failed despite GPU being available. Please run the following command to get more information:

        python -m bitsandbytes

        Inspect the output of the command and see if you can locate CUDA libraries. You might need to add them
        to your LD_LIBRARY_PATH. If you suspect a bug, please take the information from python -m bitsandbytes
        and open an issue at: https://github.com/TimDettmers/bitsandbytes/issues

Sign up or log in to comment