diff --git a/.github/workflows/_unit_test.yaml b/.github/workflows/_unit_test.yaml new file mode 100644 index 00000000..eefd325c --- /dev/null +++ b/.github/workflows/_unit_test.yaml @@ -0,0 +1,92 @@ +name: 'unit test' + +on: + workflow_call: + inputs: + vllm: + required: true + type: string + runner: + required: true + type: string + image: + required: true + type: string + type: + required: true + type: string + +jobs: + unit-test: + name: unit test + runs-on: ${{ inputs.runner }} + container: + image: ${{ inputs.image }} + env: + VLLM_LOGGING_LEVEL: ERROR + VLLM_USE_MODELSCOPE: True + SOC_VERSION: ascend910b1 + MAX_JOBS: 4 + steps: + - name: Install packages + run: | + sed -Ei 's@(ports|archive).ubuntu.com@cache-service.nginx-pypi-cache.svc.cluster.local:8081@g' /etc/apt/sources.list + pip config set global.index-url http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple + pip config set global.trusted-host cache-service.nginx-pypi-cache.svc.cluster.local + apt-get update -y + apt-get install -y python3-pip git vim wget net-tools gcc g++ cmake libnuma-dev curl gnupg2 + + - name: Checkout vllm-project/vllm repo + uses: actions/checkout@v6 + with: + repository: vllm-project/vllm + ref: ${{ inputs.vllm }} + path: ./vllm-empty + + - name: Install vllm-project/vllm from source + working-directory: ./vllm-empty + run: | + VLLM_TARGET_DEVICE=empty python3 -m pip install . --extra-index https://download.pytorch.org/whl/cpu/ + python3 -m pip uninstall -y triton + + - name: Checkout vllm-project/vllm-ascend repo + uses: actions/checkout@v6 + + - name: Install vllm-project/vllm-ascend + run: | + export PIP_EXTRA_INDEX_URL=https://mirrors.huaweicloud.com/ascend/repos/pypi + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib + python3 -m pip install -v . --extra-index https://download.pytorch.org/whl/cpu/ + python3 -m pip install -r requirements-dev.txt --extra-index https://download.pytorch.org/whl/cpu/ + + - name: Install Ascend toolkit & triton_ascend + shell: bash -l {0} + run: | + BISHENG_NAME="Ascend-BiSheng-toolkit_aarch64_20260105.run" + BISHENG_URL="https://vllm-ascend.obs.cn-north-4.myhuaweicloud.com/vllm-ascend/${BISHENG_NAME}" + wget -O "${BISHENG_NAME}" "${BISHENG_URL}" && chmod a+x "${BISHENG_NAME}" && "./${BISHENG_NAME}" --install && rm "${BISHENG_NAME}" + export PATH=/usr/local/Ascend/tools/bishengir/bin:$PATH + python3 -m pip install -i https://test.pypi.org/simple/ triton-ascend==3.2.0.dev20260105 + + - name: Run unit test + env: + VLLM_WORKER_MULTIPROC_METHOD: spawn + TORCH_DEVICE_BACKEND_AUTOLOAD: 0 + run: | + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib + pytest -sv --cov --cov-report=xml:unittests-coverage.xml tests/ut \ + --ignore tests/ut/model_loader/netloader/test_netloader_elastic.py \ + --ignore tests/ut/kv_connector/test_remote_prefill_lifecycle.py \ + --ignore tests/ut/kv_connector/test_remote_decode_lifecycle.py \ + --ignore tests/ut/core/test_scheduler_dynamic_batch.py + + - name: Upload coverage to Codecov + # only upload coverage when commits merged + if: ${{ inputs.type == 'schedule' }} + uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + flags: unittests + name: vllm-ascend + verbose: true diff --git a/.github/workflows/download_model.yaml b/.github/workflows/labled_download_model.yaml similarity index 100% rename from .github/workflows/download_model.yaml rename to .github/workflows/labled_download_model.yaml diff --git a/.github/workflows/labled_test_310.yaml b/.github/workflows/labled_test_310.yaml index 25e78506..acd06346 100644 --- a/.github/workflows/labled_test_310.yaml +++ b/.github/workflows/labled_test_310.yaml @@ -18,9 +18,6 @@ name: 310p Labeled Test on: - push: - tags: - - 'v*' pull_request: types: [ labeled ] diff --git a/.github/workflows/pr_test_light.yaml b/.github/workflows/pr_test_light.yaml index d0b15805..8deea089 100644 --- a/.github/workflows/pr_test_light.yaml +++ b/.github/workflows/pr_test_light.yaml @@ -18,9 +18,6 @@ name: E2E-Light on: - push: - branches: - - 'main' pull_request: branches: - 'main' @@ -80,82 +77,15 @@ jobs: name: unit test # only trigger unit test after lint passed and the change is e2e and ut related. if: ${{ needs.lint.result == 'success' && (needs.changes.outputs.e2e_tracker == 'true' || needs.changes.outputs.ut_tracker == 'true') }} - runs-on: linux-amd64-cpu-16-hk - container: - # fixme: vllm-ascend install failed with 8.3.rc2 on github action - image: quay.nju.edu.cn/ascend/cann:8.2.rc2-910b-ubuntu22.04-py3.11 - env: - VLLM_LOGGING_LEVEL: ERROR - VLLM_USE_MODELSCOPE: True - SOC_VERSION: ascend910b1 - MAX_JOBS: 4 strategy: matrix: vllm_version: [2f4e6548efec402b913ffddc8726230d9311948d, v0.13.0] - - steps: - - name: Install packages - run: | - sed -Ei 's@(ports|archive).ubuntu.com@cache-service.nginx-pypi-cache.svc.cluster.local:8081@g' /etc/apt/sources.list - pip config set global.index-url http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple - pip config set global.trusted-host cache-service.nginx-pypi-cache.svc.cluster.local - apt-get update -y - apt-get install -y python3-pip git vim wget net-tools gcc g++ cmake libnuma-dev curl gnupg2 - - - name: Checkout vllm-project/vllm repo - uses: actions/checkout@v6 - 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 python3 -m pip install . --extra-index https://download.pytorch.org/whl/cpu/ - python3 -m pip uninstall -y triton - - - name: Checkout vllm-project/vllm-ascend repo - uses: actions/checkout@v6 - - - name: Install vllm-project/vllm-ascend - run: | - export PIP_EXTRA_INDEX_URL=https://mirrors.huaweicloud.com/ascend/repos/pypi - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib - python3 -m pip install -v . --extra-index https://download.pytorch.org/whl/cpu/ - python3 -m pip install -r requirements-dev.txt --extra-index https://download.pytorch.org/whl/cpu/ - - - name: Install Ascend toolkit & triton_ascend - shell: bash -l {0} - run: | - BISHENG_NAME="Ascend-BiSheng-toolkit_aarch64_20260105.run" - BISHENG_URL="https://vllm-ascend.obs.cn-north-4.myhuaweicloud.com/vllm-ascend/${BISHENG_NAME}" - wget -O "${BISHENG_NAME}" "${BISHENG_URL}" && chmod a+x "${BISHENG_NAME}" && "./${BISHENG_NAME}" --install && rm "${BISHENG_NAME}" - export PATH=/usr/local/Ascend/tools/bishengir/bin:$PATH - python3 -m pip install -i https://test.pypi.org/simple/ triton-ascend==3.2.0.dev20260105 - - - name: Run unit test - env: - VLLM_WORKER_MULTIPROC_METHOD: spawn - TORCH_DEVICE_BACKEND_AUTOLOAD: 0 - run: | - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib - pytest -sv --cov --cov-report=xml:unittests-coverage.xml tests/ut \ - --ignore tests/ut/model_loader/netloader/test_netloader_elastic.py \ - --ignore tests/ut/kv_connector/test_remote_prefill_lifecycle.py \ - --ignore tests/ut/kv_connector/test_remote_decode_lifecycle.py \ - --ignore tests/ut/core/test_scheduler_dynamic_batch.py - - - name: Upload coverage to Codecov - # only upload coverage when commits merged - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: codecov/codecov-action@v5 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - flags: unittests - name: vllm-ascend - verbose: true + uses: ./.github/workflows/_unit_test.yaml + with: + vllm: ${{ matrix.vllm_version }} + runner: linux-amd64-cpu-16-hk + image: quay.nju.edu.cn/ascend/cann:8.2.rc2-910b-ubuntu22.04-py3.11 + type: pr e2e-light: name: e2e-light diff --git a/.github/workflows/schedule_codecov_refresh.yaml b/.github/workflows/schedule_codecov_refresh.yaml new file mode 100644 index 00000000..ae9000cb --- /dev/null +++ b/.github/workflows/schedule_codecov_refresh.yaml @@ -0,0 +1,42 @@ +# +# 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: Refresh codecov + +on: + schedule: + # UTC+8: 8am, 12pm, 16pm + - cron: '0 0,4,8 * * *' + +# 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: + refresh-codecov: + name: refresh codecov + strategy: + matrix: + vllm_version: [2f4e6548efec402b913ffddc8726230d9311948d] + uses: ./.github/workflows/_unit_test.yaml + with: + vllm: ${{ matrix.vllm_version }} + runner: linux-amd64-cpu-16-hk + image: quay.nju.edu.cn/ascend/cann:8.2.rc2-910b-ubuntu22.04-py3.11 + type: schedule diff --git a/.github/workflows/schedule_image_build_and_push.yaml b/.github/workflows/schedule_image_build_and_push.yaml index 679cf8d9..dce1484e 100644 --- a/.github/workflows/schedule_image_build_and_push.yaml +++ b/.github/workflows/schedule_image_build_and_push.yaml @@ -12,7 +12,8 @@ name: Image Build and Push on: schedule: - - cron: '0 */4 * * *' + # UTC+8: 8am, 12pm, 16pm, 22pm + - cron: '0 0,4,8,14 * * *' push: tags: - 'v*' diff --git a/.github/workflows/schedule_nightly_image_build.yaml b/.github/workflows/schedule_nightly_image_build.yaml index 296c7c25..fb2a2919 100644 --- a/.github/workflows/schedule_nightly_image_build.yaml +++ b/.github/workflows/schedule_nightly_image_build.yaml @@ -2,7 +2,8 @@ name: Nightly Image Build Schedule on: schedule: - - cron: '0 0,4,8,12,15 * * *' + # UTC+8: 20pm, 23pm + - cron: '0 12,15 * * *' # This workflow builds and pushes Docker images for nightly-ci # It will be built base on the quay.io/ascend/vllm-ascend:main diff --git a/.github/workflows/schedule_release_code_and_wheel.yml b/.github/workflows/schedule_release_code_and_wheel.yml index e7f3b10b..97262785 100644 --- a/.github/workflows/schedule_release_code_and_wheel.yml +++ b/.github/workflows/schedule_release_code_and_wheel.yml @@ -19,7 +19,8 @@ name: Release Code and Wheel on: schedule: - - cron: '0 */4 * * *' + # UTC+8: 10am, 16pm + - cron: '0 2,8 * * *' push: tags: - 'v*' diff --git a/.github/workflows/schedule_test_vllm_main.yaml b/.github/workflows/schedule_test_vllm_main.yaml index 93a63917..7f8c7876 100644 --- a/.github/workflows/schedule_test_vllm_main.yaml +++ b/.github/workflows/schedule_test_vllm_main.yaml @@ -17,9 +17,9 @@ name: vLLM Main Schedule Test on: - # Run full e2e tests per 4h + # Run full e2e tests UTC+8: 10am, 16pm, 22pm, 4am schedule: - - cron: '0 */4 * * *' + - cron: '0 2,8,14,20 * * *' workflow_dispatch: # Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly