# # 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: push: branches: - 'main' - '*-dev' paths: - '*.txt' - '**/*.py' - '.github/workflows/vllm_ascend_test.yaml' - '!docs/**' - 'pytest.ini' 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/ 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: | mkdir pta cd pta wget https://pytorch-package.obs.cn-north-4.myhuaweicloud.com/pta/Daily/v2.5.1/20250308.3/pytorch_v2.5.1_py310.tar.gz tar -xvf pytorch_v2.5.1_py310.tar.gz pip install ./torch_npu-2.5.1.dev20250308-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl cd .. rm -rf pta - name: Run vllm-project/vllm-ascend test run: | pytest -sv tests - name: Run vllm-project/vllm test run: | pytest -sv