|
| 1 | +# |
| 2 | +# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved. |
| 3 | +# This file is a part of the vllm-ascend project. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | + |
| 18 | +name: 'run benchmarks main' |
| 19 | + |
| 20 | +on: |
| 21 | + schedule: |
| 22 | + - cron: '00 16 * * *' |
| 23 | + workflow_dispatch: |
| 24 | + |
| 25 | + # after merged, secrets will be available |
| 26 | + # pull_request: |
| 27 | + # branches: |
| 28 | + # - 'main' |
| 29 | + # - '*-dev' |
| 30 | + # paths: |
| 31 | + # - '.github/workflows/nightly_benchmarks.yaml' |
| 32 | + |
| 33 | + |
| 34 | +# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly |
| 35 | +# declared as "shell: bash -el {0}" on steps that need to be properly activated. |
| 36 | +# It's used to activate ascend-toolkit environment variables. |
| 37 | +defaults: |
| 38 | + run: |
| 39 | + shell: bash -el {0} |
| 40 | + |
| 41 | +jobs: |
| 42 | + test: |
| 43 | + name: run benchmarks main |
| 44 | + runs-on: 'linux-arm64-npu-static-8' |
| 45 | + strategy: |
| 46 | + matrix: |
| 47 | + include: |
| 48 | + - vllm_branch: v0.9.0 |
| 49 | + vllm_ascend_branch: main |
| 50 | + container: |
| 51 | + image: m.daocloud.io/quay.io/ascend/cann:8.1.rc1-910b-ubuntu22.04-py3.10 |
| 52 | + volumes: |
| 53 | + - /usr/local/dcmi:/usr/local/dcmi |
| 54 | + - /usr/local/bin/npu-smi:/usr/local/bin/npu-smi |
| 55 | + - /usr/local/Ascend/driver/:/usr/local/Ascend/driver/ |
| 56 | + # Use self-host cache speed up pip and model download |
| 57 | + - /home/action/.cache:/github/home/.cache/ |
| 58 | + options: >- |
| 59 | + --device /dev/davinci0 |
| 60 | + --device /dev/davinci1 |
| 61 | + --device /dev/davinci_manager |
| 62 | + --device /dev/devmm_svm |
| 63 | + --device /dev/hisi_hdc |
| 64 | + env: |
| 65 | + HF_ENDPOINT: https://hf-mirror.com |
| 66 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| 67 | + ES_OM_DOMAIN: ${{ secrets.ES_OM_DOMAIN }} |
| 68 | + ES_OM_AUTHORIZATION: ${{ secrets.ES_OM_AUTHORIZATION }} |
| 69 | + steps: |
| 70 | + - name: Check npu and CANN info |
| 71 | + run: | |
| 72 | + npu-smi info |
| 73 | + cat /usr/local/Ascend/ascend-toolkit/latest/"$(uname -i)"-linux/ascend_toolkit_install.info |
| 74 | +
|
| 75 | + - name: Config mirrors |
| 76 | + run: | |
| 77 | + pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple |
| 78 | +
|
| 79 | + - name: Install system dependencies |
| 80 | + run: | |
| 81 | + apt-get update -y |
| 82 | + apt-get -y install git jq wget curl lsof gcc g++ cmake libnuma-dev |
| 83 | +
|
| 84 | + - name: Config git |
| 85 | + run: | |
| 86 | + git config --global --add safe.directory "$GITHUB_WORKSPACE" |
| 87 | + git config --global url."https://gh-proxy.test.osinfra.cn/https://github.com/".insteadOf https://github.com/ |
| 88 | + |
| 89 | + |
| 90 | + - name: Checkout vllm-project/vllm-ascend repo |
| 91 | + uses: actions/checkout@v4 |
| 92 | + with: |
| 93 | + ref: ${{ matrix.vllm_ascend_branch }} |
| 94 | + |
| 95 | + - name: Checkout vllm-project/vllm repo |
| 96 | + uses: actions/checkout@v4 |
| 97 | + with: |
| 98 | + repository: vllm-project/vllm |
| 99 | + path: ./vllm-empty |
| 100 | + ref: ${{ matrix.vllm_branch }} |
| 101 | + |
| 102 | + - name: Install vllm-project/vllm from source |
| 103 | + working-directory: ./vllm-empty |
| 104 | + run: | |
| 105 | + VLLM_TARGET_DEVICE=empty pip install -e . |
| 106 | +
|
| 107 | + - name: Install vllm-project/vllm-ascend |
| 108 | + run: | |
| 109 | + pip install -e . |
| 110 | + pip install -r benchmarks/requirements-bench.txt |
| 111 | +
|
| 112 | + - name: Checkout cosdt/elastic-tool |
| 113 | + uses: actions/checkout@v4 |
| 114 | + with: |
| 115 | + repository: cosdt/elastic-tool |
| 116 | + path: ./elastic_tool |
| 117 | + ref: 0.1.0-dev |
| 118 | + |
| 119 | + - name: Install elastic_tool |
| 120 | + working-directory: ./elastic_tool |
| 121 | + run: | |
| 122 | + pip install -e . |
| 123 | + |
| 124 | + - name: Collect pr info from vllm-project/vllm-ascend |
| 125 | + run: | |
| 126 | + # Only get the pull request which may influences performance |
| 127 | + git log --pretty=format:"%H %s" -- '**/*.py' ':!docs/*' ':!tests/*' ':!examples/*' > commit_log.txt |
| 128 | + escli check commit_log.txt |
| 129 | +
|
| 130 | + - name: Run benchmark iteration |
| 131 | + run: | |
| 132 | + while IFS= read -r line || [[ -n "$line" ]]; do |
| 133 | + commit_id=${line%% *} |
| 134 | + commit_title=${line#* } |
| 135 | + commit_time=$(git show -s --format=%cd $commit_hash --date=iso-strict) |
| 136 | + commit_time_no_tz=${commit_time::19} |
| 137 | +
|
| 138 | + git checkout $commit_id |
| 139 | + pip install -e . |
| 140 | + |
| 141 | + echo "------------------------" |
| 142 | + echo "commit_id: $commit_id" |
| 143 | + echo "commit_title: $commit_title" |
| 144 | + echo "commit_time: $commit_time_no_tz" |
| 145 | + echo "vllm branch: ${{ matrix.vllm_branch }}" |
| 146 | + echo "vllm-ascend branch: ${{ matrix.vllm_ascend_branch }}" |
| 147 | + echo "------------------------" |
| 148 | +
|
| 149 | + bash benchmarks/scripts/run-performance-benchmarks.sh |
| 150 | + # send the result to es |
| 151 | + if [[ "${{ github.event_name }}" != "pull request" ]]; then |
| 152 | + escli add --vllm_branch ${{ matrix.vllm_branch }} \ |
| 153 | + --vllm_ascend_branch ${{ matrix.vllm_ascend_branch }} \ |
| 154 | + --commit_id $commit_id \ |
| 155 | + --commit_title "$commit_title" \ |
| 156 | + --created_at "$commit_time_no_tz" \ |
| 157 | + --res_dir ./benchmarks/results |
| 158 | + rm -rf ./benchmarks/results |
| 159 | + fi |
| 160 | + done < commit_log.txt |
0 commit comments