"git@developer.sourcefind.cn:OpenDAS/bitsandbytes.git" did not exist on "1eec77d34c80b5e3b63b2e4bb4d57a7009258c8f"
Unverified Commit dada5301 authored by jiqing-feng's avatar jiqing-feng Committed by GitHub
Browse files

cpu install guide (#1227)



* cpu install guide

* update readme

* fix format

* fix format

* fix typo

* add windows guide

* fix readme to pip install . instead of building wheel

* Update docs/source/installation.mdx
Co-authored-by: default avatarSteven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/installation.mdx
Co-authored-by: default avatarSteven Liu <59462357+stevhliu@users.noreply.github.com>

* Update docs/source/installation.mdx
Co-authored-by: default avatarSteven Liu <59462357+stevhliu@users.noreply.github.com>

---------
Co-authored-by: default avatarSteven Liu <59462357+stevhliu@users.noreply.github.com>
parent 195ae616
# Installation # Installation
## CUDA
bitsandbytes is only supported on CUDA GPUs for CUDA versions **11.0 - 12.3**. bitsandbytes is only supported on CUDA GPUs for CUDA versions **11.0 - 12.3**.
The latest version of bitsandbytes (v0.43.0) builds on: The latest version of bitsandbytes (v0.43.0) builds on:
...@@ -29,7 +31,7 @@ To install from PyPI. ...@@ -29,7 +31,7 @@ To install from PyPI.
pip install bitsandbytes pip install bitsandbytes
``` ```
## Compile from source ### Compile from source
For Linux and Windows systems, you can compile bitsandbytes from source. Installing from source allows for more build options with different CMake configurations. For Linux and Windows systems, you can compile bitsandbytes from source. Installing from source allows for more build options with different CMake configurations.
...@@ -91,7 +93,7 @@ Big thanks to [wkpark](https://github.com/wkpark), [Jamezo97](https://github.com ...@@ -91,7 +93,7 @@ Big thanks to [wkpark](https://github.com/wkpark), [Jamezo97](https://github.com
</hfoption> </hfoption>
</hfoptions> </hfoptions>
## PyTorch CUDA versions ### PyTorch CUDA versions
Some bitsandbytes features may need a newer CUDA version than the one currently supported by PyTorch binaries from Conda and pip. In this case, you should follow these instructions to load a precompiled bitsandbytes binary. Some bitsandbytes features may need a newer CUDA version than the one currently supported by PyTorch binaries from Conda and pip. In this case, you should follow these instructions to load a precompiled bitsandbytes binary.
...@@ -131,3 +133,51 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/tim/local/cuda-11.7 ...@@ -131,3 +133,51 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/tim/local/cuda-11.7
``` ```
3. Now when you launch bitsandbytes with these environment variables, the PyTorch CUDA version is overridden by the new CUDA version (in this example, version 11.7) and a different bitsandbytes library is loaded. 3. Now when you launch bitsandbytes with these environment variables, the PyTorch CUDA version is overridden by the new CUDA version (in this example, version 11.7) and a different bitsandbytes library is loaded.
## Intel CPU
> [!TIP]
> Intel CPU backend only supports building from source; for now, please follow the instructions below.
Like CUDA, you can compile bitsandbytes from source for Linux and Windows systems. Installing from source allows for more build options with different CMake configurations.
<hfoptions id="source">
<hfoption id="Linux">
To compile from source, you need CMake >= **3.22.1** and Python >= **3.8** installed. Make sure you have a compiler installed to compile C++ (gcc, make, headers, etc.). For example, to install a compiler and CMake on Ubuntu:
```bash
apt-get install -y build-essential cmake
```
We recommend installing **GCC >= 11** and have at least **GCC >= 6**.
Now to install the bitsandbytes package from source, run the following commands:
```bash
git clone --branch multi-backend-refactor https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/
pip install -r requirements-dev.txt
pip install intel_extension_for_pytorch
cmake -DCOMPUTE_BACKEND=cpu -S .
make
pip install .
```
</hfoption>
<hfoption id="Windows">
Windows systems require Visual Studio with C++ support.
To compile from source, you need CMake >= **3.22.1** and Python >= **3.8** installed.
```bash
git clone --branch multi-backend-refactor https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/
pip install -r requirements-dev.txt
cmake -DCOMPUTE_BACKEND=cpu -S .
cmake --build . --config Release
pip install .
```
</hfoption>
</hfoptions>
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