[Core] Make V1 work and enable V1 engine test (#389)
1. Make sure the version is string before parse in collect_env 2. Add basic V1 engine test Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
This commit is contained in:
150
.github/workflows/vllm_ascend_test.yaml
vendored
150
.github/workflows/vllm_ascend_test.yaml
vendored
@@ -1,150 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
|
||||
# This file is a part of the vllm-ascend project.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
name: 'e2e test'
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
- '*-dev'
|
||||
paths:
|
||||
- '*.txt'
|
||||
- '**/*.py'
|
||||
- '.github/workflows/vllm_ascend_test.yaml'
|
||||
- '!docs/**'
|
||||
- 'pytest.ini'
|
||||
|
||||
# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
|
||||
# declared as "shell: bash -el {0}" on steps that need to be properly activated.
|
||||
# It's used to activate ascend-toolkit environment variables.
|
||||
defaults:
|
||||
run:
|
||||
shell: bash -el {0}
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
name: vLLM Ascend test (dispatch)
|
||||
runs-on: ascend-ci-arm64
|
||||
outputs:
|
||||
number: ${{ steps.dispatch-device.outputs.number }}
|
||||
steps:
|
||||
- name: vLLM Ascend test (dispatch)
|
||||
id: dispatch-device
|
||||
run: |
|
||||
# Try to acquire lock to dispatch devices
|
||||
lockfile /tmp/dispatch.lock
|
||||
|
||||
# Print npu info
|
||||
npu-list /dev/null 2>&1
|
||||
|
||||
# Select first available device (Skip reserved davinci1 and davinci0)
|
||||
NUMBER=$(npu-list /dev/null 2>&1 | grep None | grep -v davinci1 | grep -v davinci0 | head -1 | cut -b 15)
|
||||
echo "Dispatch to /dev/davinci$NUMBER"
|
||||
echo "number=$NUMBER" >> $GITHUB_OUTPUT
|
||||
|
||||
test:
|
||||
needs: [dispatch]
|
||||
name: vLLM Ascend test (self-host)
|
||||
runs-on: ascend-ci-arm64 # actionlint-ignore: runner-label
|
||||
|
||||
container:
|
||||
image: quay.io/ascend/cann:8.0.0-910b-ubuntu22.04-py3.10
|
||||
volumes:
|
||||
- /usr/local/dcmi:/usr/local/dcmi
|
||||
- /usr/local/bin/npu-smi:/usr/local/bin/npu-smi
|
||||
- /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/
|
||||
# Use self-host cache speed up pip and model download
|
||||
- /home/action/cache:/github/home/.cache/
|
||||
# for dispatch lock
|
||||
- /tmp/:/tmp/
|
||||
# for vllm and vllm-ascend
|
||||
- /data1/code:/code
|
||||
options: >-
|
||||
--device /dev/davinci${{ needs.dispatch.outputs.number }}
|
||||
--device /dev/davinci_manager
|
||||
--device /dev/devmm_svm
|
||||
--device /dev/hisi_hdc
|
||||
env:
|
||||
HF_ENDPOINT: https://hf-mirror.com
|
||||
steps:
|
||||
- name: Check npu and CANN info
|
||||
run: |
|
||||
npu-smi info
|
||||
cat /usr/local/Ascend/ascend-toolkit/latest/"$(uname -i)"-linux/ascend_toolkit_install.info
|
||||
# unlock
|
||||
rm -rf /tmp/dispatch.lock
|
||||
|
||||
- name: Config mirrors
|
||||
run: |
|
||||
sed -i 's|ports.ubuntu.com|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
|
||||
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
|
||||
|
||||
- name: Checkout vllm-project/vllm-ascend repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apt-get update -y
|
||||
apt-get -y install `cat packages.txt`
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r requirements-dev.txt
|
||||
|
||||
- name: Checkout vllm-project/vllm repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: vllm-project/vllm
|
||||
path: ./vllm-empty
|
||||
|
||||
- name: Install vllm-project/vllm from source
|
||||
working-directory: ./vllm-empty
|
||||
run: |
|
||||
VLLM_TARGET_DEVICE=empty pip install -e .
|
||||
|
||||
- name: Install vllm-project/vllm-ascend
|
||||
run: |
|
||||
pip install -e .
|
||||
|
||||
- name: Install pta
|
||||
run: |
|
||||
cd /code/pta/
|
||||
pip install ./torch_npu-2.5.1.dev20250320-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
|
||||
|
||||
- name: Run vllm-project/vllm-ascend test
|
||||
run: |
|
||||
VLLM_USE_V1=0 pytest -sv tests
|
||||
|
||||
- name: Run vllm-project/vllm test
|
||||
env:
|
||||
VLLM_USE_V1: 0
|
||||
PYTORCH_NPU_ALLOC_CONF: max_split_size_mb:256
|
||||
run: |
|
||||
pytest -sv
|
||||
|
||||
post_cleanup:
|
||||
name: vLLM Ascend test (post-cleanup)
|
||||
needs: [test]
|
||||
runs-on: ascend-ci-arm64 # actionlint-ignore: runner-label
|
||||
if: always()
|
||||
steps:
|
||||
- name: Remove dispatch lock if exists
|
||||
run: |
|
||||
if [ -f "/tmp/dispatch.lock" ]; then
|
||||
rm -f "/tmp/dispatch.lock"
|
||||
fi
|
||||
Reference in New Issue
Block a user