Skip to content

Commit 9c7428b

Browse files
authored
[CI] enable custom ops build (#466)
### What this PR does / why we need it? This PR enable custom ops build by default. ### Does this PR introduce _any_ user-facing change? Yes, users now install vllm-ascend from source will trigger custom ops build step. ### How was this patch tested? By image build and e2e CI --------- Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
1 parent d05ea17 commit 9c7428b

22 files changed

+159
-336
lines changed

.github/actionlint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
self-hosted-runner:
2+
# Labels of self-hosted runner in array of strings.
3+
labels:
4+
- linux-arm64-npu-1
5+
- linux-arm64-npu-4

.github/workflows/actionlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646
fetch-depth: 0
4747

4848
- name: "Run actionlint"
49+
env:
50+
SHELLCHECK_OPTS: --exclude=SC2046,SC2006
4951
run: |
5052
echo "::add-matcher::.github/workflows/matchers/actionlint.json"
5153
tools/actionlint.sh -color

.github/workflows/image_openeuler.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ jobs:
7272

7373
- name: Build - Set up QEMU
7474
uses: docker/setup-qemu-action@v3
75-
# TODO(yikun): remove this after https://github.com/docker/setup-qemu-action/issues/198 resolved
76-
with:
77-
image: tonistiigi/binfmt:qemu-v7.0.0-28
7875

7976
- name: Build - Set up Docker Buildx
8077
uses: docker/setup-buildx-action@v3
@@ -98,3 +95,7 @@ jobs:
9895
labels: ${{ steps.meta.outputs.labels }}
9996
tags: ${{ steps.meta.outputs.tags }}
10097
file: Dockerfile.openEuler
98+
# TODO: support and enable custom ops build for openEuler
99+
build-args: |
100+
PIP_INDEX_URL=https://pypi.org/simple
101+
COMPILE_CUSTOM_KERNELS=0

.github/workflows/image.yml renamed to .github/workflows/image_ubuntu.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- 'main'
1717
- '*-dev'
1818
paths:
19-
- '.github/workflows/image.yml'
19+
- '.github/workflows/image_ubuntu.yml'
2020
- 'Dockerfile'
2121
- 'vllm_ascend/**'
2222
push:
@@ -27,13 +27,13 @@ on:
2727
tags:
2828
- 'v*'
2929
paths:
30-
- '.github/workflows/image.yml'
30+
- '.github/workflows/image_ubuntu.yml'
3131
- 'Dockerfile'
3232
- 'vllm_ascend/**'
3333
jobs:
3434

3535
build:
36-
name: vllm-ascend image
36+
name: vllm-ascend Ubuntu image
3737
runs-on: ubuntu-latest
3838

3939
steps:
@@ -72,9 +72,6 @@ jobs:
7272

7373
- name: Build - Set up QEMU
7474
uses: docker/setup-qemu-action@v3
75-
# TODO(yikun): remove this after https://github.com/docker/setup-qemu-action/issues/198 resolved
76-
with:
77-
image: tonistiigi/binfmt:qemu-v7.0.0-28
7875

7976
- name: Build - Set up Docker Buildx
8077
uses: docker/setup-buildx-action@v3
@@ -98,4 +95,4 @@ jobs:
9895
labels: ${{ steps.meta.outputs.labels }}
9996
tags: ${{ steps.meta.outputs.tags }}
10097
build-args: |
101-
PIP_INDEX_URL=https://pypi.org/simple
98+
PIP_INDEX_URL=https://pypi.org/simple

.github/workflows/vllm_ascend_test.yaml

Lines changed: 22 additions & 248 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ concurrency:
4141
cancel-in-progress: true
4242

4343
jobs:
44-
test-singlenpu:
45-
name: vLLM Ascend test main(single-npu)
46-
runs-on: linux-arm64-npu-1 # actionlint-ignore: runner-label
44+
test:
45+
strategy:
46+
max-parallel: 2
47+
matrix:
48+
os: [linux-arm64-npu-1, linux-arm64-npu-4]
49+
vllm_verison: [main, v0.8.3]
50+
name: vLLM Ascend test
51+
runs-on: ${{ matrix.os }}
4752
container:
4853
image: quay.io/ascend/cann:8.0.0-910b-ubuntu22.04-py3.10
4954
steps:
@@ -72,18 +77,14 @@ jobs:
7277
uses: actions/checkout@v4
7378
with:
7479
repository: vllm-project/vllm
80+
ref: ${{ matrix.vllm_verison }}
7581
path: ./vllm-empty
7682

7783
- name: Install vllm-project/vllm from source
7884
working-directory: ./vllm-empty
7985
run: |
8086
VLLM_TARGET_DEVICE=empty pip install -e .
8187
82-
- name: Install vllm-project/vllm-ascend
83-
run: |
84-
pip install -r requirements-dev.txt
85-
pip install -e .
86-
8788
- name: Install pta
8889
run: |
8990
if [ ! -d /root/.cache/pta ]; then
@@ -99,182 +100,37 @@ jobs:
99100
100101
pip install /root/.cache/pta/torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
101102
102-
- name: Run vllm-project/vllm-ascend test on V0 engine
103-
env:
104-
VLLM_USE_V1: 0
105-
HF_ENDPOINT: https://hf-mirror.com
106-
run: |
107-
VLLM_USE_V1=0 pytest -sv -m 'not multinpu' tests
108-
109-
- name: Run vllm-project/vllm-ascend test for V1 Engine
110-
env:
111-
VLLM_USE_V1: 1
112-
VLLM_WORKER_MULTIPROC_METHOD: spawn
113-
HF_ENDPOINT: https://hf-mirror.com
114-
run: |
115-
pytest -sv -m 'not multinpu' tests
116-
117-
- name: Run vllm-project/vllm test for V0 Engine
118-
env:
119-
VLLM_USE_V1: 0
120-
PYTORCH_NPU_ALLOC_CONF: max_split_size_mb:256
121-
HF_ENDPOINT: https://hf-mirror.com
122-
run: |
123-
pytest -sv
124-
125-
test-multinpu:
126-
name: vLLM Ascend test main(multi-npu)
127-
runs-on: linux-arm64-npu-4
128-
container:
129-
image: ascendai/cann:8.0.0-910b-ubuntu22.04-py3.10
130-
env:
131-
HF_ENDPOINT: https://hf-mirror.com
132-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
133-
steps:
134-
- name: Check npu and CANN info
135-
run: |
136-
npu-smi info
137-
cat /usr/local/Ascend/ascend-toolkit/latest/"$(uname -i)"-linux/ascend_toolkit_install.info
138-
139-
- name: Config mirrors
140-
run: |
141-
# sed -i 's|ports.ubuntu.com|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
142-
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
143-
144-
- name: Install system dependencies
145-
run: |
146-
apt-get update -y
147-
apt-get -y install git wget
148-
149-
- name: Config git
150-
run: |
151-
git config --global url."https://gh-proxy.test.osinfra.cn/https://github.com/".insteadOf https://github.com/
152-
153-
- name: Checkout vllm-project/vllm-ascend repo
154-
uses: actions/checkout@v4
155-
156-
- name: Install dependencies
157-
run: |
158-
pip install -r requirements-dev.txt
159-
160-
- name: Checkout vllm-project/vllm repo
161-
uses: actions/checkout@v4
162-
with:
163-
repository: vllm-project/vllm
164-
path: ./vllm-empty
165-
166-
- name: Install vllm-project/vllm from source
167-
working-directory: ./vllm-empty
168-
run: |
169-
VLLM_TARGET_DEVICE=empty pip install -e .
170-
171103
- name: Install vllm-project/vllm-ascend
172104
run: |
173105
pip install -r requirements-dev.txt
174106
pip install -e .
175107
176-
- name: Install pta
177-
run: |
178-
if [ ! -d /root/.cache/pta ]; then
179-
mkdir -p /root/.cache/pta
180-
fi
181-
182-
if [ ! -f /root/.cache/pta/torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl ]; then
183-
cd /root/.cache/pta
184-
rm -rf pytorch_v2.5.1_py310*
185-
wget https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/Daily/v2.5.1/20250320.3/pytorch_v2.5.1_py310.tar.gz
186-
tar -zxvf pytorch_v2.5.1_py310.tar.gz
187-
fi
188-
189-
pip install /root/.cache/pta/torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
190108
- name: Run vllm-project/vllm-ascend test on V0 engine
191109
env:
192110
VLLM_USE_V1: 0
193111
HF_ENDPOINT: https://hf-mirror.com
194112
run: |
195-
VLLM_USE_V1=0 pytest -sv -m 'multinpu' tests
196-
197-
- name: Run vllm-project/vllm-ascend test for V1 Engine
198-
env:
199-
VLLM_USE_V1: 1
200-
VLLM_WORKER_MULTIPROC_METHOD: spawn
201-
HF_ENDPOINT: https://hf-mirror.com
202-
run: |
203-
pytest -sv -m 'multinpu' tests
204-
205-
test-singlenpu-v0_8_3:
206-
name: vLLM Ascend test v0.8.3(single-npu)
207-
runs-on: linux-arm64-npu-1 # actionlint-ignore: runner-label
208-
container:
209-
image: quay.io/ascend/cann:8.0.0-910b-ubuntu22.04-py3.10
210-
steps:
211-
- name: Check npu and CANN info
212-
run: |
213-
npu-smi info
214-
cat /usr/local/Ascend/ascend-toolkit/latest/"$(uname -i)"-linux/ascend_toolkit_install.info
215-
216-
- name: Config mirrors
217-
run: |
218-
sed -i 's|ports.ubuntu.com|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
219-
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
220-
apt-get update -y
221-
apt install git -y
222-
git config --global url."https://gh-proxy.test.osinfra.cn/https://github.com/".insteadOf https://github.com/
223-
224-
- name: Checkout vllm-project/vllm-ascend repo
225-
uses: actions/checkout@v4
226-
227-
- name: Install system dependencies
228-
run: |
229-
apt-get -y install `cat packages.txt`
230-
apt-get -y install gcc g++ cmake libnuma-dev
231-
232-
- name: Checkout vllm-project/vllm repo
233-
uses: actions/checkout@v4
234-
with:
235-
repository: vllm-project/vllm
236-
ref: v0.8.3
237-
path: ./vllm-empty
238-
239-
- name: Install vllm-project/vllm from source
240-
working-directory: ./vllm-empty
241-
run: |
242-
VLLM_TARGET_DEVICE=empty pip install -e .
243-
244-
- name: Install vllm-project/vllm-ascend
245-
run: |
246-
pip install -r requirements-dev.txt
247-
pip install -e .
248-
249-
- name: Install pta
250-
run: |
251-
if [ ! -d /root/.cache/pta ]; then
252-
mkdir -p /root/.cache/pta
253-
fi
254-
255-
if [ ! -f /root/.cache/pta/torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl ]; then
256-
cd /root/.cache/pta
257-
rm -rf pytorch_v2.5.1_py310*
258-
wget https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/Daily/v2.5.1/20250320.3/pytorch_v2.5.1_py310.tar.gz
259-
tar -zxvf pytorch_v2.5.1_py310.tar.gz
113+
if [[ "${{ matrix.os }}" == "linux-arm64-npu-1" ]]; then
114+
pytest -sv tests/singlecard
115+
pytest -sv tests/ops
116+
else
117+
pytest -sv tests/multicard
118+
pytest -sv tests/ops
260119
fi
261120
262-
pip install /root/.cache/pta/torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
263-
264-
- name: Run vllm-project/vllm-ascend test on V0 engine
265-
env:
266-
VLLM_USE_V1: 0
267-
HF_ENDPOINT: https://hf-mirror.com
268-
run: |
269-
VLLM_USE_V1=0 pytest -sv -m 'not multinpu' tests
270-
271121
- name: Run vllm-project/vllm-ascend test for V1 Engine
272122
env:
273123
VLLM_USE_V1: 1
274124
VLLM_WORKER_MULTIPROC_METHOD: spawn
275125
HF_ENDPOINT: https://hf-mirror.com
276126
run: |
277-
pytest -sv -m 'not multinpu' tests
127+
if [[ "${{ matrix.os }}" == "linux-arm64-npu-1" ]]; then
128+
pytest -sv tests/singlecard
129+
pytest -sv tests/ops
130+
else
131+
pytest -sv tests/multicard
132+
pytest -sv tests/ops
133+
fi
278134
279135
- name: Run vllm-project/vllm test for V0 Engine
280136
env:
@@ -283,85 +139,3 @@ jobs:
283139
HF_ENDPOINT: https://hf-mirror.com
284140
run: |
285141
pytest -sv
286-
287-
test-multinpu-v0_8_3:
288-
name: vLLM Ascend test v0.8.3(multi-npu)
289-
runs-on: linux-arm64-npu-4
290-
needs: test-multinpu
291-
container:
292-
image: ascendai/cann:8.0.0-910b-ubuntu22.04-py3.10
293-
env:
294-
HF_ENDPOINT: https://hf-mirror.com
295-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
296-
steps:
297-
- name: Check npu and CANN info
298-
run: |
299-
npu-smi info
300-
cat /usr/local/Ascend/ascend-toolkit/latest/"$(uname -i)"-linux/ascend_toolkit_install.info
301-
302-
- name: Config mirrors
303-
run: |
304-
# sed -i 's|ports.ubuntu.com|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
305-
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
306-
307-
- name: Install system dependencies
308-
run: |
309-
apt-get update -y
310-
apt-get -y install git wget
311-
312-
- name: Config git
313-
run: |
314-
git config --global url."https://gh-proxy.test.osinfra.cn/https://github.com/".insteadOf https://github.com/
315-
316-
- name: Checkout vllm-project/vllm-ascend repo
317-
uses: actions/checkout@v4
318-
319-
- name: Install dependencies
320-
run: |
321-
pip install -r requirements-dev.txt
322-
323-
- name: Checkout vllm-project/vllm repo
324-
uses: actions/checkout@v4
325-
with:
326-
repository: vllm-project/vllm
327-
ref: v0.8.3
328-
path: ./vllm-empty
329-
330-
- name: Install vllm-project/vllm from source
331-
working-directory: ./vllm-empty
332-
run: |
333-
VLLM_TARGET_DEVICE=empty pip install -e .
334-
335-
- name: Install vllm-project/vllm-ascend
336-
run: |
337-
pip install -r requirements-dev.txt
338-
pip install -e .
339-
340-
- name: Install pta
341-
run: |
342-
if [ ! -d /root/.cache/pta ]; then
343-
mkdir -p /root/.cache/pta
344-
fi
345-
346-
if [ ! -f /root/.cache/pta/torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl ]; then
347-
cd /root/.cache/pta
348-
rm -rf pytorch_v2.5.1_py310*
349-
wget https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/Daily/v2.5.1/20250320.3/pytorch_v2.5.1_py310.tar.gz
350-
tar -zxvf pytorch_v2.5.1_py310.tar.gz
351-
fi
352-
353-
pip install /root/.cache/pta/torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
354-
- name: Run vllm-project/vllm-ascend test on V0 engine
355-
env:
356-
VLLM_USE_V1: 0
357-
HF_ENDPOINT: https://hf-mirror.com
358-
run: |
359-
VLLM_USE_V1=0 pytest -sv -m 'multinpu' tests
360-
361-
- name: Run vllm-project/vllm-ascend test for V1 Engine
362-
env:
363-
VLLM_USE_V1: 1
364-
VLLM_WORKER_MULTIPROC_METHOD: spawn
365-
HF_ENDPOINT: https://hf-mirror.com
366-
run: |
367-
pytest -sv -m 'multinpu' tests

0 commit comments

Comments
 (0)