installation.mdx 2.11 KB
Newer Older
Titus's avatar
Titus committed
1
2
# Installation

Younes Belkada's avatar
Younes Belkada committed
3
4
5
6
7
Note currently `bitsandbytes` is only supported on CUDA GPU hardwares, support for AMD GPUs and M1 chips (MacOS) is coming soon.

<hfoptions id="OS system">
<hfoption id="Linux">

Titus's avatar
Titus committed
8
9
10
11
12
13
## Hardware requirements:
 - LLM.int8(): NVIDIA Turing (RTX 20xx; T4) or Ampere GPU (RTX 30xx; A4-A100); (a GPU from 2018 or newer).
 - 8-bit optimizers and quantization: NVIDIA Kepler GPU or newer (>=GTX 78X).

Supported CUDA versions: 10.2 - 12.0  #TODO: check currently supported versions

Younes Belkada's avatar
Younes Belkada committed
14
15
16
17
18
19
20
21
22
23
## Linux

### From Pypi

```bash
pip install bitsandbytes
```

### From source

24
25
You need CMake and Python installed. For Linux, make sure to install a compiler (`apt install build-essential`, for example).

Younes Belkada's avatar
Younes Belkada committed
26
27
```bash
git clone https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/
28
29
30
pip install -r requirements-dev.txt
cmake -DCOMPUTE_BACKEND=cuda -S .
make
31
pip install .
Younes Belkada's avatar
Younes Belkada committed
32
```
33
Note support for non-CUDA GPUs (e.g. AMD, Intel, Apple Silicon), is also coming soon.
Titus's avatar
Titus committed
34
For a more detailed compilation guide, head to the [dedicated page on the topic](./compiling)
Younes Belkada's avatar
Younes Belkada committed
35
36
37
38
39
40

</hfoption>
<hfoption id="Windows">

## Windows

41
42
Windows builds require Visual Studio with C++ support, as well as the Cuda SDK installed.

Titus's avatar
Titus committed
43
Currently for Windows users, you need to build bitsandbytes from source:
Younes Belkada's avatar
Younes Belkada committed
44
45
46

```bash
git clone https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/
47
48
49
pip install -r requirements-dev.txt
cmake -DCOMPUTE_BACKEND=cuda -S .
cmake --build . --config Release
Younes Belkada's avatar
Younes Belkada committed
50
51
52
python -m build --wheel
```

53
Big thanks to [wkpark](https://github.com/wkpark), [Jamezo97](https://github.com/Jamezo97), [rickardp](https://github.com/rickardp), [akx](https://github.com/akx) for their amazing contributions to make bitsandbytes compatible with Windows.
Younes Belkada's avatar
Younes Belkada committed
54

Titus's avatar
Titus committed
55
56
For a more detailed compilation guide, head to the [dedicated page on the topic](./compiling)

Younes Belkada's avatar
Younes Belkada committed
57
</hfoption>
Titus's avatar
Titus committed
58
59
60
61
62
63
64
65
<hfoption id="MacOS">

## MacOS

Mac support is still a work in progress. Please make sure to check out the [Apple Silicon implementation coordination issue](https://github.com/TimDettmers/bitsandbytes/issues/1020) to get notified about the discussions and progress with respect to MacOS integration.

</hfoption>

Younes Belkada's avatar
Younes Belkada committed
66
</hfoptions>