Skip to content

Commit 19ce67d

Browse files
committed
add install doc and update readme
1 parent e30021e commit 19ce67d

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ bitsandbytes has the following minimum requirements for all platforms:
113113
<td>✅</td>
114114
<td>✅</td>
115115
</tr>
116+
<tr>
117+
<td></td>
118+
<td>🟧 Ascend NPU <br><code>npu</code></td>
119+
<td>Atlas 800T A2+</td>
120+
<td>❌</td>
121+
<td>✅</td>
122+
<td>❌</td>
123+
</tr>
116124
<tr>
117125
<td colspan="6">🪟 <strong>Windows 11 / Windows Server 2019+</strong></td>
118126
</tr>

docs/source/installation.mdx

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Welcome to the installation guide for the `bitsandbytes` library! This document provides step-by-step instructions to install `bitsandbytes` across various platforms and hardware configurations.
44

5-
We provide official support for NVIDIA GPUs, CPUs, Intel XPUs, and Intel Gaudi platforms. We also have experimental support for
5+
We provide official support for NVIDIA GPUs, CPUs, Intel XPUs, Intel Gaudi, and Ascend NPU platforms. We also have experimental support for
66
additional platforms such as AMD ROCm.
77

88
## Table of Contents
@@ -15,6 +15,8 @@ additional platforms such as AMD ROCm.
1515
- [Installation via PyPI](#xpu-pip)
1616
- [Intel Gaudi](#gaudi)
1717
- [Installation via PyPI](#gaudi-pip)
18+
- [Ascend NPU](#npu)
19+
- [Compile from Source](#npu-compile)
1820
- [CPU](#cpu)
1921
- [Installation via PyPI](#cpu-pip)
2022
- [Compile from Source](#cpu-compile)
@@ -156,6 +158,35 @@ Use `pip` or `uv` to install the latest release:
156158
pip install bitsandbytes
157159
```
158160

161+
## Ascend NPU[[npu]]
162+
163+
Please refer to [the official Ascend installations instructions](https://www.hiascend.com/document/detail/zh/Pytorch/60RC3/configandinstg/instg/insg_0001.html) for guidance on how to install the necessary `torch_npu` dependency.
164+
165+
### Compile from Source[[npu-compile]]
166+
167+
> [!WARNING]
168+
> Before building on Ascend NPU:
169+
>
170+
> Make sure to source the CANN environment script (adjust path based on your installation):
171+
>
172+
> ```bash
173+
> source /usr/local/Ascend/ascend-toolkit/set_env.sh
174+
> ```
175+
>
176+
> CANN toolkit can be downloaded from: [https://www.hiascend.com/zh/developer/download/community/result?module=cann](https://www.hiascend.com/zh/developer/download/community/result?module=cann)
177+
178+
```bash
179+
# Install bitsandbytes from source
180+
# Clone bitsandbytes repo, Ascend NPU backend is currently enabled on main branch
181+
git clone https://github.com/bitsandbytes-foundation/bitsandbytes.git && cd bitsandbytes/
182+
183+
# Compile & install
184+
apt-get install -y build-essential cmake # install build tools dependencies, unless present
185+
cmake -DCOMPUTE_BACKEND=npu -S .
186+
make
187+
pip install -e . # `-e` for "editable" install, when developing BNB (otherwise leave that out)
188+
```
189+
159190
## CPU[[cpu]]
160191

161192
### Installation from PyPI[[cpu-pip]]

0 commit comments

Comments
 (0)