Skip to content

Commit

Permalink
cpu install guide (#1227)
Browse files Browse the repository at this point in the history
* 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: Steven Liu <[email protected]>

* Update docs/source/installation.mdx

Co-authored-by: Steven Liu <[email protected]>

* Update docs/source/installation.mdx

Co-authored-by: Steven Liu <[email protected]>

---------

Co-authored-by: Steven Liu <[email protected]>
  • Loading branch information
jiqing-feng and stevhliu authored Jun 21, 2024
1 parent 195ae61 commit dada530
Showing 1 changed file with 52 additions and 2 deletions.
54 changes: 52 additions & 2 deletions docs/source/installation.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Installation

## CUDA

bitsandbytes is only supported on CUDA GPUs for CUDA versions **11.0 - 12.3**.

The latest version of bitsandbytes (v0.43.0) builds on:
Expand Down Expand Up @@ -29,7 +31,7 @@ To install from PyPI.
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.

Expand Down Expand Up @@ -91,7 +93,7 @@ Big thanks to [wkpark](https://github.com/wkpark), [Jamezo97](https://github.com
</hfoption>
</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.

Expand Down Expand Up @@ -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.


## 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>

0 comments on commit dada530

Please sign in to comment.