Skip to content

Commit a9636f9

Browse files
committed
[Build] Integrate MindIE Turbo into vLLM Ascend
Signed-off-by: MengqingCao <[email protected]>
1 parent 188df15 commit a9636f9

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

docs/source/installation.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,20 @@ python -m venv vllm-ascend-env
7878
source vllm-ascend-env/bin/activate
7979

8080
# Install required python packages.
81-
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple attrs numpy<2.0.0 decorator sympy cffi pyyaml pathlib2 psutil protobuf scipy requests absl-py wheel typing_extensions
81+
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple attrs 'numpy<2.0.0' decorator sympy cffi pyyaml pathlib2 psutil protobuf scipy requests absl-py wheel typing_extensions
8282

8383
# Download and install the CANN package.
84-
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%208.0.0/Ascend-cann-toolkit_8.0.0_linux-aarch64.run
84+
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL%20V100R001C21B800TP051/Ascend-cann-toolkit_8.1.RC1.alpha002_linux-aarch64.run
8585
chmod +x ./Ascend-cann-toolkit_8.0.0_linux-aarch64.run
8686
./Ascend-cann-toolkit_8.0.0_linux-aarch64.run --full
8787

8888
source /usr/local/Ascend/ascend-toolkit/set_env.sh
8989

90-
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
90+
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL%20V100R001C21B800TP051/Ascend-cann-kernels-910b_8.1.RC1.alpha002_linux-aarch64.run
9191
chmod +x ./Ascend-cann-kernels-910b_8.0.0_linux-aarch64.run
9292
./Ascend-cann-kernels-910b_8.0.0_linux-aarch64.run --install
9393

94+
# TODO: replace with the latest nnal
9495
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/CANN/CANN%208.0.0/Ascend-cann-nnal_8.0.0_linux-aarch64.run
9596
chmod +x ./Ascend-cann-nnal_8.0.0_linux-aarch64.run
9697
./Ascend-cann-nnal_8.0.0_linux-aarch64.run --install
@@ -138,6 +139,15 @@ pip install vllm==|pip_vllm_version|
138139
pip install vllm-ascend==|pip_vllm_ascend_version| --extra-index https://download.pytorch.org/whl/cpu/
139140
```
140141

142+
**Optional**
143+
Install MindIE Turbo for Performance acceleration:
144+
145+
```{code-block} bash
146+
:substitutions:
147+
# Install MindIE Turbo
148+
pip install vllm-ascend[mindie_turbo]==|pip_vllm_ascend_version| --extra-index https://download.pytorch.org/whl/cpu/
149+
```
150+
141151
:::{dropdown} Click here to see "Build from source code"
142152
or build from **source code**:
143153

@@ -154,6 +164,15 @@ git clone --depth 1 --branch |vllm_ascend_version| https://github.com/vllm-proj
154164
cd vllm-ascend
155165
pip install -e . --extra-index https://download.pytorch.org/whl/cpu/
156166
```
167+
168+
**Optional**
169+
Install MindIE Turbo for Performance acceleration:
170+
171+
```{code-block} bash
172+
:substitutions:
173+
# Install MindIE Turbo
174+
pip install mindie_turbo
175+
```
157176
:::
158177

159178
::::
@@ -194,6 +213,10 @@ docker run --rm \
194213
-it $IMAGE bash
195214
```
196215

216+
```{note}
217+
vLLM and vLLM Ascend code are placed in `/workspace` in the docker image. And they are installed in develop mode so that the developer could easily modify the code.
218+
```
219+
197220
::::
198221

199222
:::::
@@ -257,3 +280,10 @@ Prompt: 'The president of the United States is', Generated text: ' a very import
257280
Prompt: 'The capital of France is', Generated text: ' Paris. The oldest part of the city is Saint-Germain-des-Pr'
258281
Prompt: 'The future of AI is', Generated text: ' not bright\n\nThere is no doubt that the evolution of AI will have a huge'
259282
```
283+
284+
### Perfermance Acceleration
285+
286+
Get more performance gains by optimizing Python and torch-npu with the Bisheng compiler, please follow these official turtorial:
287+
288+
[Optimizing Python with Bisheng](https://www.hiascend.com/document/detail/zh/Pytorch/600/ptmoddevg/trainingmigrguide/performance_tuning_0063.html)
289+
[Optimizing torch-npu with Bisheng](https://www.hiascend.com/document/detail/zh/Pytorch/600/ptmoddevg/trainingmigrguide/performance_tuning_0058.html)

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,9 @@ def _read_requirements(filename: str) -> List[str]:
368368
install_requires=get_requirements(),
369369
ext_modules=ext_modules,
370370
cmdclass=cmdclass,
371-
extras_require={},
371+
extras_require={
372+
"mindie_turbo": ["mindie-turbo"]
373+
},
372374
entry_points={
373375
"vllm.platform_plugins": ["ascend = vllm_ascend:register"],
374376
"vllm.general_plugins":

0 commit comments

Comments
 (0)