You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/installation.mdx
+42-29Lines changed: 42 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## CUDA
4
4
5
-
bitsandbytes is only supported on CUDA GPUs for CUDA versions **11.0 - 12.5**.
5
+
bitsandbytes is only supported on CUDA GPUs for CUDA versions **11.0 - 12.5**. However, there's a multi-backend effort under way which is currently in alpha release, check [the respective section below in case you're interested to help us with early feedback](#multi-backend).
6
6
7
7
The latest version of bitsandbytes builds on:
8
8
@@ -31,7 +31,7 @@ To install from PyPI.
31
31
pip install bitsandbytes
32
32
```
33
33
34
-
### Compile from source
34
+
### Compile from source[[compile]]
35
35
36
36
For Linux and Windows systems, you can compile bitsandbytes from source. Installing from source allows for more build options with different CMake configurations.
37
37
@@ -61,7 +61,7 @@ git clone https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/
61
61
pip install -r requirements-dev.txt
62
62
cmake -DCOMPUTE_BACKEND=cuda -S .
63
63
make
64
-
pip install .
64
+
pip install -e .# `-e` for "editable" install, when developing BNB (otherwise leave that out)
65
65
```
66
66
67
67
> [!TIP]
@@ -85,7 +85,7 @@ git clone https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/
85
85
pip install -r requirements-dev.txt
86
86
cmake -DCOMPUTE_BACKEND=cuda -S .
87
87
cmake --build . --config Release
88
-
python -m build --wheel
88
+
pip install -e .# `-e` for "editable" install, when developing BNB (otherwise leave that out)
89
89
```
90
90
91
91
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.
@@ -129,55 +129,68 @@ For example, to use a local install path:
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.
Please follow these steps to install bitsandbytes with device-specific backend support other than CUDA:
139
140
140
-
> [!TIP]
141
-
> Intel CPU backend only supports building from source; for now, please follow the instructions below.
141
+
<hfoptionsid="backend">
142
+
<hfoptionid="AMD ROCm">
142
143
143
-
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.
144
+
### AMD GPU
144
145
145
-
<hfoptionsid="source">
146
-
<hfoptionid="Linux">
146
+
bitsandbytes is fully supported from ROCm 6.1 onwards (currently in alpha release).
147
147
148
-
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:
148
+
> [!TIP]
149
+
> If you already installed ROCm and PyTorch, skip Docker steps below and please check that the torch version matches your ROCm install. To install torch for a specific ROCm version, please refer to step 3 of wheels install in [Installing PyTorch for ROCm](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/3rd-party/pytorch-install.html#using-wheels-package) guide.
149
150
150
151
```bash
151
-
apt-get install -y build-essential cmake
152
-
```
153
-
154
-
We recommend installing **GCC >= 11** and have at least **GCC >= 6**.
152
+
# Create a docker container with latest pytorch. It comes with ROCm and pytorch preinstalled
153
+
docker pull rocm/pytorch:latest
154
+
docker run -it --device=/dev/kfd --device=/dev/dri --group-add video rocm/pytorch:latest
155
155
156
-
Now to install the bitsandbytes package from source, run the following commands:
156
+
# Clone bitsandbytes repo, ROCm backend is currently enabled on multi-backend-refactor branch
Similar to the CUDA case, you can compile bitsandbytes from source for Linux and Windows systems.
178
+
179
+
The below commands are for Linux. For installing on Windows, please adapt the below commands according to the same pattern as described [the section above on compiling from source under the Windows tab](#compile).
180
+
181
+
```
182
+
git clone --depth 1 -b multi-backend-refactor https://github.com/TimDettmers/bitsandbytes.git && cd bitsandbytes/
183
+
pip install intel_extension_for_pytorch
176
184
pip install -r requirements-dev.txt
177
185
cmake -DCOMPUTE_BACKEND=cpu -S .
178
-
cmake --build . --config Release
179
-
pip install .
186
+
make
187
+
pip install -e . # `-e` for "editable" install, when developing BNB (otherwise leave that out)
0 commit comments