Skip to content

Commit 2e20797

Browse files
authored
[BUILD] Upgrade torch-npu to 2.5.1 (#661)
### What this PR does / why we need it? The torch-npu 2.5.1 are published: https://pypi.org/project/torch-npu/2.5.1/ It's time to remove all torch-npu dev version from vllm-ascend code base ### Does this PR introduce _any_ user-facing change? Yes, using torch-npu 2.5.1 ### How was this patch tested? - [ ] CI passed - [ ] Manually test - [ ] Grep all `dev2025` --------- Signed-off-by: Yikun Jiang <yikunkero@gmail.com>
1 parent fa4a5d9 commit 2e20797

File tree

14 files changed

+43
-88
lines changed

14 files changed

+43
-88
lines changed

.github/workflows/mypy.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
runs-on: ubuntu-latest
3939
strategy:
4040
matrix:
41-
python-version: ["3.9", "3.10", "3.11", "3.12"]
41+
# TODO(yikun): Add 3.12 back when torch-npu support 3.12
42+
python-version: ["3.9", "3.10", "3.11"]
4243
steps:
4344
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4445
- name: Set up Python ${{ matrix.python-version }}
@@ -47,7 +48,7 @@ jobs:
4748
python-version: ${{ matrix.python-version }}
4849
- name: Install dependencies
4950
run: |
50-
pip install -r requirements-dev.txt
51+
pip install -r requirements-dev.txt --extra-index-url https://download.pytorch.org/whl/cpu
5152
5253
- name: Checkout vllm-project/vllm repo
5354
uses: actions/checkout@v4

.github/workflows/vllm_ascend_test.yaml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,25 +97,10 @@ jobs:
9797
run: |
9898
VLLM_TARGET_DEVICE=empty pip install -e .
9999
100-
- name: Install pta
101-
run: |
102-
if [ ! -d /root/.cache/pta ]; then
103-
mkdir -p /root/.cache/pta
104-
fi
105-
106-
if [ ! -f /root/.cache/pta/torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl ]; then
107-
cd /root/.cache/pta
108-
rm -rf pytorch_v2.5.1_py310*
109-
wget https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/Daily/v2.5.1/20250320.3/pytorch_v2.5.1_py310.tar.gz
110-
tar -zxvf pytorch_v2.5.1_py310.tar.gz
111-
fi
112-
113-
pip install /root/.cache/pta/torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
114-
115100
- name: Install vllm-project/vllm-ascend
116101
run: |
117102
pip install -r requirements-dev.txt
118-
pip install -v --no-build-isolation -e .
103+
pip install -v -e .
119104
120105
- name: Run vllm-project/vllm-ascend test for V1 Engine
121106
env:

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ include(${CMAKE_CURRENT_LIST_DIR}/cmake/utils.cmake)
1010
# Suppress potential warnings about unused manually-specified variables
1111
set(ignoreMe "${VLLM_PYTHON_PATH}")
1212

13-
set(PYTHON_SUPPORTED_VERSIONS "3.9" "3.10" "3.11" "3.12")
13+
# TODO: Add 3.12 back when torch-npu support 3.12
14+
set(PYTHON_SUPPORTED_VERSIONS "3.9" "3.10" "3.11")
1415

1516
find_package(pybind11 REQUIRED)
1617

Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ RUN pip config set global.index-url ${PIP_INDEX_URL}
3939
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
4040
ARG VLLM_TAG=v0.8.4
4141
RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /workspace/vllm
42-
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install /workspace/vllm/ --extra-index https://download.pytorch.org/whl/cpu/
4342
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
44-
RUN python3 -m pip uninstall -y triton
45-
46-
# Install torch-npu
47-
RUN bash /workspace/vllm-ascend/pta_install.sh
43+
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -v -e /workspace/vllm/ --extra-index https://download.pytorch.org/whl/cpu/ && \
44+
python3 -m pip uninstall -y triton && \
45+
python3 -m pip cache purge
4846

4947
# Install vllm-ascend
48+
# Append `libascend_hal.so` path (devlib) to LD_LIBRARY_PATH
5049
RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
5150
source /usr/local/Ascend/nnal/atb/set_env.sh && \
52-
export LD_LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/`uname -i`-linux/devlib:$LD_LIBRARY_PATH && \
53-
export LIBRARY_PATH=/usr/local/Ascend/ascend-toolkit/latest/lib64:$LIBRARY_PATH && \
54-
python3 -m pip install -v /workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/
51+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/`uname -i`-linux/devlib && \
52+
python3 -m pip install -v -e /workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
53+
python3 -m pip cache purge
5554

5655
# Install modelscope (for fast download) and ray (for multinode)
57-
RUN python3 -m pip install modelscope ray
56+
RUN python3 -m pip install modelscope ray && \
57+
python3 -m pip cache purge
5858

5959
CMD ["/bin/bash"]

Dockerfile.openEuler

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install /workspace/vllm/ --extra-i
4242
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
4343
RUN python3 -m pip uninstall -y triton
4444

45-
# Install torch-npu
46-
RUN bash /workspace/vllm-ascend/pta_install.sh
47-
4845
# Install vllm-ascend
4946
RUN source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
5047
source /usr/local/Ascend/nnal/atb/set_env.sh && \

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ By using vLLM Ascend plugin, popular open-source models, including Transformer-l
3636
- Hardware: Atlas 800I A2 Inference series, Atlas A2 Training series
3737
- OS: Linux
3838
- Software:
39-
* Python >= 3.9
39+
* Python >= 3.9, < 3.12
4040
* CANN >= 8.0.0
41-
* PyTorch >= 2.5.1, torch-npu >= 2.5.1.dev20250320
41+
* PyTorch >= 2.5.1, torch-npu >= 2.5.1
4242
* vLLM (the same version as vllm-ascend)
4343

4444
## Getting Started

README.zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ vLLM 昇腾插件 (`vllm-ascend`) 是一个由社区维护的让vLLM在Ascend NP
3939
- 软件:
4040
* Python >= 3.9
4141
* CANN >= 8.0.RC2
42-
* PyTorch >= 2.5.1, torch-npu >= 2.5.1.dev20250320
42+
* PyTorch >= 2.5.1, torch-npu >= 2.5.1
4343
* vLLM (与vllm-ascend版本一致)
4444

4545
## 开始使用

docs/source/developer_guide/versioning_policy.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,22 @@ As shown above:
6161
- `version` documentation: Corresponds to specific released versions (e.g., `v0.7.3`, `v0.7.3rc1`). No further updates after release.
6262
- `stable` documentation (**not yet released**): Official release documentation. Updates are allowed in real-time after release, typically based on vX.Y.Z-dev. Once stable documentation is available, non-stable versions should display a header warning: `You are viewing the latest developer preview docs. Click here to view docs for the latest stable release.`.
6363

64+
## Software Dependency Management
65+
- `torch-npu`: Ascend Extension for PyTorch (torch-npu) releases a stable version to [PyPi](https://pypi.org/project/torch-npu)
66+
every 3 months, a development version (aka the POC version) every month, and a nightly version every day.
67+
The PyPi stable version **CAN** be used in vLLM Ascend final version, the monthly dev version **ONLY CANN** be used in
68+
vLLM Ascend RC version for rapid iteration, the nightly version **CANNOT** be used in vLLM Ascend any version and branches.
69+
6470
## Release Compatibility Matrix
6571

6672
Following is the Release Compatibility Matrix for vLLM Ascend Plugin:
6773

68-
| vllm-ascend | vLLM | Python | Stable CANN | PyTorch/torch_npu |
69-
|--------------|--------------| --- | --- | --- |
70-
| v0.8.4rc1 | v0.8.4 | 3.9 - 3.12 | 8.0.0 | 2.5.1 / 2.5.1.dev20250320 |
71-
| v0.7.3rc2 | v0.7.3 | 3.9 - 3.12 | 8.0.0 | 2.5.1 / 2.5.1.dev20250320 |
72-
| v0.7.3rc1 | v0.7.3 | 3.9 - 3.12 | 8.0.0 | 2.5.1 / 2.5.1.dev20250308 |
73-
| v0.7.1rc1 | v0.7.1 | 3.9 - 3.12 | 8.0.0 | 2.5.1 / 2.5.1.dev20250218 |
74+
| vllm-ascend | vLLM | Python | Stable CANN | PyTorch/torch_npu |
75+
|--------------|--------------|----------------| --- | --- |
76+
| v0.8.4rc1 | v0.8.4 | >= 3.9, < 3.12 | 8.0.0 | 2.5.1 / 2.5.1.dev20250320 |
77+
| v0.7.3rc2 | v0.7.3 | >= 3.9, < 3.12 | 8.0.0 | 2.5.1 / 2.5.1.dev20250320 |
78+
| v0.7.3rc1 | v0.7.3 | >= 3.9, < 3.12 | 8.0.0 | 2.5.1 / 2.5.1.dev20250308 |
79+
| v0.7.1rc1 | v0.7.1 | >= 3.9, < 3.12 | 8.0.0 | 2.5.1 / 2.5.1.dev20250218 |
7480

7581
## Release cadence
7682

docs/source/installation.md

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ This document describes how to install vllm-ascend manually.
55
## Requirements
66

77
- OS: Linux
8-
- Python: 3.9 or higher
8+
- Python: >= 3.9, < 3.12
99
- A hardware with Ascend NPU. It's usually the Atlas 800 A2 series.
1010
- Software:
1111

12-
| Software | Supported version | Note |
13-
| ------------ | ----------------- | ---- |
14-
| CANN | >= 8.0.0 | Required for vllm-ascend and torch-npu |
15-
| torch-npu | >= 2.5.1.dev20250320 | Required for vllm-ascend |
16-
| torch | >= 2.5.1 | Required for torch-npu and vllm |
12+
| Software | Supported version | Note |
13+
|-----------|-------------------|----------------------------------------|
14+
| CANN | >= 8.0.0 | Required for vllm-ascend and torch-npu |
15+
| torch-npu | >= 2.5.1 | Required for vllm-ascend |
16+
| torch | >= 2.5.1 | Required for torch-npu and vllm |
1717

1818
You have 2 way to install:
1919
- **Using pip**: first prepare env manually or via CANN image, then install `vllm-ascend` using pip.
@@ -127,27 +127,6 @@ apt update -y
127127
apt install -y gcc g++ cmake libnuma-dev wget
128128
```
129129

130-
Current version depends on a unreleased `torch-npu`, you need to install manually:
131-
132-
```
133-
# Once the packages are installed, you need to install `torch-npu` manually,
134-
# because that vllm-ascend relies on an unreleased version of torch-npu.
135-
# This step will be removed in the next vllm-ascend release.
136-
#
137-
# Here we take python 3.10 on aarch64 as an example. Feel free to install the correct version for your environment. See:
138-
#
139-
# https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/Daily/v2.5.1/20250320.3/pytorch_v2.5.1_py39.tar.gz
140-
# https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/Daily/v2.5.1/20250320.3/pytorch_v2.5.1_py310.tar.gz
141-
# https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/Daily/v2.5.1/20250320.3/pytorch_v2.5.1_py311.tar.gz
142-
#
143-
mkdir pta
144-
cd pta
145-
wget https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/Daily/v2.5.1/20250320.3/pytorch_v2.5.1_py310.tar.gz
146-
tar -xvf pytorch_v2.5.1_py310.tar.gz
147-
pip install ./torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
148-
cd ..
149-
```
150-
151130
**[Optinal]** Config the extra-index of `pip` if you are working on a **x86** machine, so that the torch with cpu could be found:
152131

153132
```bash
@@ -181,13 +160,13 @@ or build from **source code**:
181160
# Install vLLM
182161
git clone --depth 1 --branch |vllm_version| https://github.com/vllm-project/vllm
183162
cd vllm
184-
VLLM_TARGET_DEVICE=empty pip install .
163+
VLLM_TARGET_DEVICE=empty pip install -e -v .
185164
cd ..
186165
187166
# Install vLLM Ascend
188167
git clone --depth 1 --branch |vllm_ascend_version| https://github.com/vllm-project/vllm-ascend.git
189168
cd vllm-ascend
190-
python setup.py develop
169+
pip install -e -v .
191170
cd ..
192171
```
193172

pta_install.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)