2025-02-11 12:00:27 +08:00
# Installation
2025-02-13 18:44:17 +08:00
## Dependencies
2025-02-05 10:53:12 +08:00
| Requirement | Supported version | Recommended version | Note |
| ------------ | ------- | ----------- | ----------- |
| Python | >= 3.9 | [3.10 ](https://www.python.org/downloads/ ) | Required for vllm |
| CANN | >= 8.0.RC2 | [8.0.RC3 ](https://www.hiascend.com/developer/download/community/result?module=cann&cann=8.0.0.beta1 ) | Required for vllm-ascend and torch-npu |
| torch-npu | >= 2.4.0 | [2.5.1rc1 ](https://gitee.com/ascend/pytorch/releases/tag/v6.0.0.alpha001-pytorch2.5.1 ) | Required for vllm-ascend |
| torch | >= 2.4.0 | [2.5.1 ](https://github.com/pytorch/pytorch/releases/tag/v2.5.1 ) | Required for torch-npu and vllm required |
2025-02-13 18:44:17 +08:00
## Prepare Ascend NPU environment
2025-02-05 10:53:12 +08:00
Below is a quick note to install recommended version software:
2025-02-13 18:44:17 +08:00
### Containerized installation
2025-02-05 10:53:12 +08:00
You can use the [container image ](https://hub.docker.com/r/ascendai/cann ) directly with one line command:
```bash
docker run \
--name vllm-ascend-env \
--device /dev/davinci1 \
--device /dev/davinci_manager \
--device /dev/devmm_svm \
--device /dev/hisi_hdc \
-v /usr/local/dcmi:/usr/local/dcmi \
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
-v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \
-v /etc/ascend_install.info:/etc/ascend_install.info \
-it quay.io/ascend/cann:8.0.rc3.beta1-910b-ubuntu22.04-py3.10 bash
```
You do not need to install `torch` and `torch_npu` manually, they will be automatically installed as `vllm-ascend` dependencies.
2025-02-13 18:44:17 +08:00
### Manual installation
2025-02-05 10:53:12 +08:00
Or follow the instructions provided in the [Ascend Installation Guide ](https://ascend.github.io/docs/sources/ascend/quick_install.html ) to set up the environment.
2025-02-13 18:44:17 +08:00
## Building
2025-02-11 14:28:26 +08:00
2025-02-13 18:44:17 +08:00
### Build Python package from source
2025-02-11 14:28:26 +08:00
```bash
git clone https://github.com/vllm-project/vllm-ascend.git
cd vllm-ascend
pip install -e .
```
2025-02-13 18:44:17 +08:00
### Build container image from source
2025-02-11 14:28:26 +08:00
```bash
git clone https://github.com/vllm-project/vllm-ascend.git
cd vllm-ascend
docker build -t vllm-ascend-dev-image -f ./Dockerfile .
```