fix pyproject.toml confict with requirement.txt and requirements-dev.txt #12613
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved. | |
# | |
# 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. | |
# This file is a part of the vllm-ascend project. | |
# | |
name: 'test' | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
- '*-dev' | |
paths: | |
- '*.txt' | |
- '**/*.py' | |
- '.github/workflows/vllm_ascend_test.yaml' | |
- '!docs/**' | |
- 'pytest.ini' | |
- '!benchmarks/**' | |
- 'tools/mypy.sh' | |
- 'mypy.ini' | |
- '.github/workflows/*.ya?ml' | |
- '.github/workflows/actionlint.*' | |
- '.github/workflows/matchers/actionlint.json' | |
# 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: | |
lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
vllm_version: [v0.9.1] | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-lint.txt | |
- name: Run codespell check | |
run: | | |
CODESPELL_EXCLUDES=('--skip' 'tests/prompts/**,./benchmarks/sonnet.txt,*tests/lora/data/**,build/**,./vllm_ascend.egg-info/**') | |
CODESPELL_IGNORE_WORDS=('-L' 'CANN,cann,NNAL,nnal,ASCEND,ascend,EnQue,CopyIn') | |
codespell --toml pyproject.toml "${CODESPELL_EXCLUDES[@]}" "${CODESPELL_IGNORE_WORDS[@]}" | |
- name: Analysing the code with ruff | |
run: | | |
echo "::add-matcher::.github/workflows/matchers/ruff.json" | |
ruff check --output-format github . | |
- name: Run isort | |
run: | | |
isort . --check-only | |
- name: Running yapf | |
run: | | |
python -m pip install --upgrade pip | |
pip install toml | |
pip install yapf==0.32.0 | |
yapf --diff --recursive . | |
- name: Install dependencies | |
run: | | |
pip install -r requirements-dev.txt --extra-index-url https://download.pytorch.org/whl/cpu | |
- name: Checkout vllm-project/vllm repo | |
uses: actions/checkout@v4 | |
with: | |
repository: vllm-project/vllm | |
ref: ${{ matrix.vllm_version }} | |
path: vllm-empty | |
- name: Actionlint Check | |
env: | |
SHELLCHECK_OPTS: --exclude=SC2046,SC2006,SC2086 | |
run: | | |
echo "::add-matcher::.github/workflows/matchers/actionlint.json" | |
tools/actionlint.sh -color | |
- name: Install vllm-project/vllm from source | |
working-directory: vllm-empty | |
run: | | |
pip install -r requirements/build.txt --extra-index-url https://download.pytorch.org/whl/cpu | |
VLLM_TARGET_DEVICE=empty pip install . | |
- name: Mypy Check | |
run: | | |
echo "::add-matcher::.github/workflows/matchers/mypy.json" | |
tools/mypy.sh 1 ${{ matrix.python-version }} | |
e2e: | |
needs: [lint] | |
if: ${{ needs.lint.result == 'success' }} | |
strategy: | |
max-parallel: 2 | |
matrix: | |
os: [linux-aarch64-a2-1, linux-aarch64-a2-4] | |
vllm_version: [v0.9.1] | |
concurrency: | |
group: > | |
${{ | |
matrix.os == 'linux-aarch64-a2-4' | |
&& github.event.pull_request.number | |
&& format('pr-{0}-limit-npu-4', github.event.pull_request.number) | |
|| format('job-{0}-{1}-{2}', matrix.os, matrix.vllm_version, github.event.pull_request.number) | |
}} | |
cancel-in-progress: false | |
name: vLLM Ascend test | |
runs-on: ${{ matrix.os }} | |
container: | |
image: swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:8.2.rc1-910b-ubuntu22.04-py3.11 | |
env: | |
HF_ENDPOINT: https://hf-mirror.com | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
VLLM_LOGGING_LEVEL: ERROR | |
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 | |
- 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 | |
apt-get update -y | |
apt install git -y | |
git config --global url."https://gh-proxy.test.osinfra.cn/https://github.com/".insteadOf https://github.com/ | |
- name: Checkout vllm-project/vllm-ascend repo | |
uses: actions/checkout@v4 | |
- name: Install system dependencies | |
run: | | |
apt-get -y install `cat packages.txt` | |
apt-get -y install gcc g++ cmake libnuma-dev | |
- name: Checkout vllm-project/vllm repo | |
uses: actions/checkout@v4 | |
with: | |
repository: vllm-project/vllm | |
ref: ${{ matrix.vllm_version }} | |
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 -r requirements-dev.txt | |
pip install -v -e . | |
- name: Run vllm-project/vllm-ascend test for V1 Engine | |
env: | |
VLLM_USE_V1: 1 | |
VLLM_WORKER_MULTIPROC_METHOD: spawn | |
run: | | |
if [[ "${{ matrix.os }}" == "linux-aarch64-a2-1" ]]; then | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/singlecard/test_offline_inference.py | |
pytest -sv tests/singlecard/test_guided_decoding.py | |
# test_ascend_config.py should be ran separately because it will regenerate the global config many times. | |
pytest -sv tests/singlecard/test_ascend_config.py | |
pytest -sv tests/singlecard/test_camem.py | |
pytest -sv tests/singlecard/core/test_ascend_scheduler.py | |
pytest -sv tests/singlecard/core/test_ascend_scheduler_e2e.py | |
pytest -sv tests/singlecard/ \ | |
--ignore=tests/singlecard/test_offline_inference.py \ | |
--ignore=tests/singlecard/test_guided_decoding.py \ | |
--ignore=tests/singlecard/test_ascend_config.py \ | |
--ignore=tests/singlecard/test_camem.py \ | |
--ignore=tests/singlecard/core/test_ascend_scheduler.py \ | |
--ignore=tests/singlecard/core/test_ascend_scheduler_e2e.py | |
else | |
pytest -sv tests/multicard/test_ilama_lora_tp2.py | |
# To avoid oom, we need to run the test in a single process. | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_w4a8_deepseek.py::test_deepseek_W4A8 | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_QwQ | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_topk | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek_W8A8 | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek_dbo | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek_w8a8_ep_dbo | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeekV3_dbo | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_QwQ_with_flashcomm_v1 | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_Qwen3_with_flashcomm_v2 | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/ --ignore=tests/multicard/test_ilama_lora_tp2.py --ignore=tests/multicard/test_offline_inference_distributed.py --ignore=tests/multicard/test_w4a8_deepseek.py | |
fi | |
- name: Run vllm-project/vllm-ascend test on V0 engine | |
if: ${{ github.event_name == 'schedule' }} | |
env: | |
VLLM_USE_V1: 0 | |
run: | | |
if [[ "${{ matrix.os }}" == "linux-aarch64-a2-1" ]]; then | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/singlecard/test_offline_inference.py | |
pytest -sv tests/singlecard/test_guided_decoding.py | |
pytest -sv tests/singlecard/test_camem.py | |
# test_ascend_config.py should be ran separately because it will regenerate the global config many times. | |
pytest -sv tests/singlecard/test_ascend_config.py | |
pytest -sv tests/singlecard/test_prompt_embedding.py | |
pytest -sv tests/singlecard/ \ | |
--ignore=tests/singlecard/test_offline_inference.py \ | |
--ignore=tests/singlecard/test_guided_decoding.py \ | |
--ignore=tests/singlecard/test_camem.py \ | |
--ignore=tests/singlecard/test_ascend_config.py \ | |
--ignore=tests/singlecard/test_prompt_embedding.py \ | |
--ignore=tests/singlecard/core/test_ascend_scheduler.py \ | |
--ignore=tests/singlecard/core/test_ascend_scheduler_e2e.py | |
else | |
pytest -sv tests/multicard/test_ilama_lora_tp2.py | |
# Fixme: run VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py will raise error. | |
# To avoid oom, we need to run the test in a single process. | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_QwQ | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_topk | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek_W8A8 | |
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/ --ignore=tests/multicard/test_ilama_lora_tp2.py --ignore=tests/multicard/test_offline_inference_distributed.py | |
fi |