Skip to content

Commit 8fdb89f

Browse files
committed
Refeactor installatio docn
Signed-off-by: Yikun Jiang <yikunkero@gmail.com>
1 parent 2a67814 commit 8fdb89f

File tree

3 files changed

+69
-79
lines changed

3 files changed

+69
-79
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ Run the following command to start the vLLM server with the [Qwen/Qwen2.5-0.5B-I
6868
vllm serve Qwen/Qwen2.5-0.5B-Instruct
6969
curl http://localhost:8000/v1/models
7070
```
71-
**Please refer to [official docs](https://vllm-ascend.readthedocs.io/en/latest/) for more details.**
71+
72+
Please refer to [QuickStart](https://vllm-ascend.readthedocs.io/en/latest/quick_start.html) and [Installation](https://vllm-ascend.readthedocs.io/en/latest/installation.html) for more details.
7273

7374
## Contributing
7475
See [CONTRIBUTING](docs/source/developer_guide/contributing.md) for more details, which is a step-by-step guide to help you set up development environment, build and test.

README.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ vllm serve Qwen/Qwen2.5-0.5B-Instruct
6969
curl http://localhost:8000/v1/models
7070
```
7171

72-
**请参阅 [官方文档](https://vllm-ascend.readthedocs.io/en/latest/)以获取更多详细信息**
72+
请查看[快速开始](https://vllm-ascend.readthedocs.io/en/latest/quick_start.html)[安装指南](https://vllm-ascend.readthedocs.io/en/latest/installation.html)了解更多.
7373

7474
## 分支
7575

docs/source/installation.md

Lines changed: 66 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,30 @@ This document describes how to install vllm-ascend manually.
1717

1818
## Configure a new environment
1919

20-
Before installing the package, you need to make sure firmware/driver and CANN is installed correctly.
20+
Before installing, you need to make sure firmware/driver and CANN is installed correctly.
2121

2222
### Install firmwares and drivers
2323

24-
To verify that the Ascend NPU firmware and driver were correctly installed, run `npu-smi info`.
25-
26-
> Tips: Refer to [Ascend Environment Setup Guide](https://ascend.github.io/docs/sources/ascend/quick_install.html) for more details.
27-
28-
### Install CANN (optional)
29-
30-
The installation of CANN wouldn’t be necessary if you are using a CANN container image, you can skip this step.If you want to install vllm-ascend on a bare environment by hand, you need install CANN first.
24+
To verify that the Ascend NPU firmware and driver were correctly installed, run:
3125

3226
```bash
33-
# Create a virtual environment
34-
python -m venv vllm-ascend-env
35-
source vllm-ascend-env/bin/activate
36-
37-
# Install required python packages.
38-
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple attrs numpy==1.24.0 decorator sympy cffi pyyaml pathlib2 psutil protobuf scipy requests absl-py wheel typing_extensions
39-
40-
# Download and install the CANN package.
41-
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%208.0.0/Ascend-cann-toolkit_8.0.0_linux-aarch64.run
42-
sh Ascend-cann-toolkit_8.0.0_linux-aarch64.run --full
43-
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%208.0.0/Ascend-cann-kernels-910b_8.0.0_linux-aarch64.run
44-
sh Ascend-cann-kernels-910b_8.0.0_linux-aarch64.run --full
27+
npu-smi info
4528
```
4629

47-
Once it's done, you can read either **Set up using Python** or **Set up using Docker** section to install and use vllm-ascend.
30+
Refer to [Ascend Environment Setup Guide](https://ascend.github.io/docs/sources/ascend/quick_install.html) for more details.
31+
32+
### Install CANN
4833

49-
## Set up using Python
34+
:::::{tab-set}
35+
:sync-group: install
5036

51-
> Notes: If you are installing vllm-ascend on an arch64 machine, The `-f https://download.pytorch.org/whl/torch/` command parameter in this section can be omitted. It's only used for find torch package on x86 machine.
37+
::::{tab-item} Using pip
38+
:selected:
39+
:sync: pip
5240

53-
Please make sure that CANN is installed. It can be done by **Configure a new environment** step. Or by using an CANN container directly:
41+
The easiest way to prepare your CANN environment is using container directly:
5442

5543
```bash
56-
# Setup a CANN container using docker
5744
# Update DEVICE according to your device (/dev/davinci[0-7])
5845
DEVICE=/dev/davinci7
5946

@@ -71,58 +58,75 @@ docker run --rm \
7158
-it quay.io/ascend/cann:8.0.0.beta1-910b-ubuntu22.04-py3.10 bash
7259
```
7360

74-
Then you can install vllm-ascend from **pre-built wheel** or **source code**.
61+
You can also install CANN manually:
7562

76-
### Install from Pre-built wheels (Not support yet)
63+
```bash
64+
# Create a virtual environment
65+
python -m venv vllm-ascend-env
66+
source vllm-ascend-env/bin/activate
7767

78-
1. Install vllm
68+
# Install required python packages.
69+
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple attrs numpy==1.24.0 decorator sympy cffi pyyaml pathlib2 psutil protobuf scipy requests absl-py wheel typing_extensions
7970

80-
Since vllm on pypi is not compatible with cpu, we need to install vllm from source code.
71+
# Download and install the CANN package.
72+
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%208.0.0/Ascend-cann-toolkit_8.0.0_linux-aarch64.run
73+
sh Ascend-cann-toolkit_8.0.0_linux-aarch64.run --full
74+
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%208.0.0/Ascend-cann-kernels-910b_8.0.0_linux-aarch64.run
75+
sh Ascend-cann-kernels-910b_8.0.0_linux-aarch64.run --full
76+
```
8177

82-
```bash
83-
git clone --depth 1 --branch v0.7.1 https://github.com/vllm-project/vllm
84-
cd vllm
85-
VLLM_TARGET_DEVICE=empty pip install . -f https://download.pytorch.org/whl/torch/
86-
```
78+
::::
8779

88-
2. Install vllm-ascend
80+
::::{tab-item} Using Docker
81+
:sync: docker
82+
No more extra step if you are using `vllm-ascend` image.
83+
::::
84+
:::::
8985

90-
```bash
91-
pip install vllm-ascend -f https://download.pytorch.org/whl/torch/
92-
```
86+
Once it's done, you can start to set up `vllm` and `vllm-ascend`.
9387

94-
### Install from source code
88+
## Setup vllm and vllm-ascend
9589

96-
1. Install vllm
90+
:::::{tab-set}
91+
:sync-group: install
9792

98-
```bash
99-
git clone https://github.com/vllm-project/vllm
100-
cd vllm
101-
VLLM_TARGET_DEVICE=empty pip install . -f https://download.pytorch.org/whl/torch/
102-
```
93+
::::{tab-item} Using pip
94+
:selected:
95+
:sync: pip
10396

104-
2. Install vllm-ascend
97+
You can install `vllm` and `vllm-ascend` from **pre-built wheel**:
10598

106-
```bash
107-
git clone https://github.com/vllm-project/vllm-ascend.git
108-
cd vllm-ascend
109-
pip install -e . -f https://download.pytorch.org/whl/torch/
110-
```
99+
```bash
100+
pip install vllm vllm-ascend -f https://download.pytorch.org/whl/torch/
101+
```
111102

112-
## Set up using Docker
103+
or build from **source code**:
104+
105+
```bash
106+
git clone https://github.com/vllm-project/vllm
107+
cd vllm
108+
VLLM_TARGET_DEVICE=empty pip install . -f https://download.pytorch.org/whl/torch/
109+
110+
git clone https://github.com/vllm-project/vllm-ascend.git
111+
cd vllm-ascend
112+
pip install -e . -f https://download.pytorch.org/whl/torch/
113+
```
113114

114-
> Tips: CANN, torch, torch_npu, vllm and vllm_ascend are pre-installed in the Docker image already.
115+
::::
115116

116-
### Pre-built images (Not support yet)
117+
::::{tab-item} Using docker
118+
:sync: docker
117119

118-
Just pull the image and run it with bash.
120+
You can just pull the **prebuilt image** and run it with bash.
119121

120122
```bash
121-
docker pull quay.io/ascend/vllm-ascend:latest
123+
122124

123125
# Update DEVICE according to your device (/dev/davinci[0-7])
124126
DEVICE=/dev/davinci7
125-
127+
# Update the vllm-ascend image
128+
IMAGE=quay.io/ascend/vllm-ascend:main
129+
docker pull $IMAGE
126130
docker run --rm \
127131
--name vllm-ascend-env \
128132
--device $DEVICE \
@@ -134,35 +138,20 @@ docker run --rm \
134138
-v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \
135139
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \
136140
-v /etc/ascend_install.info:/etc/ascend_install.info \
137-
-it quay.io/ascend/vllm-ascend:0.7.1rc1 bash
141+
-it $IMAGE bash
138142
```
139143

140-
### Build image from source
141-
142-
If you want to build the docker image from main branch, you can do it by following steps:
144+
or build IMAGE from **source code**:
143145

144146
```bash
145147
git clone https://github.com/vllm-project/vllm-ascend.git
146148
cd vllm-ascend
147-
148149
docker build -t vllm-ascend-dev-image:latest -f ./Dockerfile .
150+
```
149151

150-
# Update DEVICE according to your device (/dev/davinci[0-7])
151-
DEVICE=/dev/davinci7
152+
::::
152153

153-
docker run --rm \
154-
--name vllm-ascend-env \
155-
--device $DEVICE \
156-
--device /dev/davinci_manager \
157-
--device /dev/devmm_svm \
158-
--device /dev/hisi_hdc \
159-
-v /usr/local/dcmi:/usr/local/dcmi \
160-
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
161-
-v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \
162-
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \
163-
-v /etc/ascend_install.info:/etc/ascend_install.info \
164-
-it vllm-ascend-dev-image:latest bash
165-
```
154+
:::::
166155

167156
## Extra information
168157

0 commit comments

Comments
 (0)