skip to content
snuow's brain

Windowsでtransformersとbit量子化したときのbitsandbytesのエラー

Windows環境でbitsandbytesに起因するエラーが出ました。なんだか、Windowsだと単に`pip install bitsandbytes`じゃダメみたい。

概要

  • llama-2系のモデルを扱うときにbit量子化しようとしたら、エラーが出た。
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
  • Windows環境でbitandbytesは普通にpip install bitsandbytesじゃダメみたい。

解決策

  1. pip uninstall bitsandbytesで既存のbitsandbytesをuninstallする
  2. pip install git+https://github.com/Keith-Hon/bitsandbytes-windows.git でWindows用のbitsandbytesをインストール
  3. 解決

参考