Skip to content

Commit 55016da

Browse files
authored
Add installation docs for Ascend NPU (#1442)
1 parent 64d382d commit 55016da

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/source/installation.mdx

+33
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/YOUR_USERNAME/local/cuda-12.6
213213
| **Apple Silicon (MPS)** | WIP | 3.10+ | M1/M2 chips | Planned |
214214
| **Intel CPU** | v2.4.0+ (`ipex`) | 3.10+ | Intel CPU | Alpha |
215215
| **Intel GPU** | v2.4.0+ (`ipex`) | 3.10+ | Intel GPU | Experimental |
216+
| **Ascend NPU** | 2.1.0+ (`torch_npu`) | 3.10+ | Ascend NPU | Experimental |
216217

217218
For each supported backend, follow the respective instructions below:
218219

@@ -285,6 +286,13 @@ pip install --force-reinstall 'https://github.com/bitsandbytes-foundation/bitsan
285286
pip install --force-reinstall 'https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_multi-backend-refactor/bitsandbytes-0.44.1.dev0-py3-none-win_amd64.whl'
286287
```
287288

289+
</hfoption>
290+
<hfoption id="Ascend NPU">
291+
292+
Compatible hardware and functioning `import torch_npu` capable environment with Python `3.10` as the minimum requirement.
293+
294+
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 pip install the necessary `torch_npu` dependency.
295+
288296
</hfoption>
289297
<hfoption id="Mac">
290298

@@ -344,6 +352,31 @@ make
344352
pip install -e . # `-e` for "editable" install, when developing BNB (otherwise leave that out)
345353
```
346354

355+
</hfoption>
356+
<hfoption id="Ascend NPU">
357+
358+
#### Ascend NPU
359+
360+
> [!TIP]
361+
> Ascend NPU backend only supports building from source; for now, please follow the instructions below.
362+
363+
364+
```
365+
# Install bitsandbytes from source
366+
# Clone bitsandbytes repo, Ascend NPU backend is currently enabled on multi-backend-refactor branch
367+
git clone -b multi-backend-refactor https://github.com/bitsandbytes-foundation/bitsandbytes.git && cd bitsandbytes/
368+
369+
# Install dependencies
370+
pip install -r requirements-dev.txt
371+
372+
# Compile & install
373+
apt-get install -y build-essential cmake # install build tools dependencies, unless present
374+
cmake -DCOMPUTE_BACKEND=npu -S .
375+
make
376+
pip install -e . # `-e` for "editable" install, when developing BNB (otherwise leave that out)
377+
```
378+
379+
347380
</hfoption>
348381
<hfoption id="Apple Silicon (MPS)">
349382

0 commit comments

Comments
 (0)