Skip to content

Commit 46b1eff

Browse files
committed
tmp
Signed-off-by: Yikun Jiang <yikunkero@gmail.com>
1 parent 6a1c510 commit 46b1eff

File tree

2 files changed

+46
-29
lines changed

2 files changed

+46
-29
lines changed

.github/workflows/accuracy_test.yaml

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
# This file is a part of the vllm-ascend project.
1616
#
1717

18+
# This test will be triggered:
19+
# 1. PR labeled with: '*accuracy-test' (ONLY 1 label valid) & 'ready-for-test'
20+
# 2. workflow_dispatch with models input
21+
# See detail rule in strategy.matrix note
1822
name: Benchmarks / accuracy
1923

2024
on:
@@ -26,6 +30,8 @@ on:
2630
description: 'vllm version:'
2731
required: true
2832
type: choice
33+
# Please also update this when bump matched version
34+
# Current supported vLLM versions
2935
options:
3036
- main
3137
- v0.9.0.1
@@ -46,6 +52,7 @@ on:
4652
- all
4753
- Qwen/Qwen2.5-7B-Instruct
4854
- Qwen/Qwen2.5-VL-7B-Instruct
55+
- Qwen/Qwen3-8B-Base
4956
default: 'all'
5057

5158
# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
@@ -56,16 +63,16 @@ defaults:
5663
shell: bash -el {0}
5764

5865
jobs:
59-
model_tests:
60-
# test will be triggered when tag '*-accuracy-test' & 'ready-for-test' or schedule job
66+
accuracy_tests:
67+
# test will be triggered when tag '*-accuracy-test' & 'ready-for-test' or workflow_dispatch job
6168
if: >-
6269
${{
63-
(contains(github.event.pull_request.labels.*.name, 'vl-accuracy-test') ||
70+
(contains(github.event.pull_request.labels.*.name, 'accuracy-test') ||
71+
contains(github.event.pull_request.labels.*.name, 'vl-accuracy-test') ||
6472
contains(github.event.pull_request.labels.*.name, 'dense-accuracy-test')) &&
6573
contains(github.event.pull_request.labels.*.name, 'ready-for-test') ||
6674
github.event_name == 'workflow_dispatch'
6775
}}
68-
name: Model Test - ${{ matrix.model_name }}
6976
runs-on: 'linux-arm64-npu-2'
7077
strategy:
7178
matrix:
@@ -74,24 +81,35 @@ jobs:
7481
# - all: Qwen/Qwen2.5-7B-Instruct, Qwen/Qwen2.5-VL-7B-Instruct, Qwen/Qwen3-8B-Base
7582
# - specified but not all: Qwen/Qwen2.5-7B-Instruct, Qwen/Qwen2.5-VL-7B-Instruct, Qwen/Qwen3-8B-Base
7683
# 2. PR labeled with "*-accuracy-test"
84+
# - accuracy-test: Qwen/Qwen2.5-7B-Instruct, Qwen/Qwen2.5-VL-7B-Instruct
7785
# - dense-accuracy-test: Qwen/Qwen2.5-7B-Instruct
7886
# - vl-accuracy-test: Qwen/Qwen2.5-VL-7B-Instruct
7987
include: ${{ fromJSON(
80-
(github.event.inputs.models == 'all' && '[{"model_name":"Qwen/Qwen2.5-7B-Instruct"},{"model_name":"meta-llama/Llama-3.1-8B-Instruct"},{"model_name":"Qwen/Qwen2.5-VL-7B-Instruct"}, {"model_name":"Qwen/Qwen3-8B-Base"}]') ||
88+
(github.event.inputs.models == 'all' && '[{"model_name":"Qwen/Qwen2.5-7B-Instruct"},{"model_name":"Qwen/Qwen2.5-VL-7B-Instruct"},{"model_name":"Qwen/Qwen3-8B-Base"}]') ||
8189
(github.event.inputs.models == 'Qwen/Qwen2.5-7B-Instruct' && '[{"model_name":"Qwen/Qwen2.5-7B-Instruct"}]') ||
8290
(github.event.inputs.models == 'Qwen/Qwen2.5-VL-7B-Instruct' && '[{"model_name":"Qwen/Qwen2.5-VL-7B-Instruct"}]') ||
91+
(github.event.inputs.models == 'Qwen/Qwen3-8B-Base' && '[{"model_name":"Qwen/Qwen3-8B-Base"}]') ||
92+
contains(github.event.pull_request.labels.*.name, 'accuracy-test') && '[{"model_name":"Qwen/Qwen2.5-7B-Instruct"},{"model_name":"Qwen/Qwen2.5-VL-7B-Instruct"}]' ||
8393
contains(github.event.pull_request.labels.*.name, 'dense-accuracy-test') && '[{"model_name":"Qwen/Qwen2.5-7B-Instruct"}]' ||
8494
contains(github.event.pull_request.labels.*.name, 'vl-accuracy-test') && '[{"model_name":"Qwen/Qwen2.5-VL-7B-Instruct"}]'
8595
) }}
8696
fail-fast: false
87-
97+
name: ${{ matrix.model_name }} accuracy
8898
container:
8999
image: m.daocloud.io/quay.io/ascend/cann:8.1.rc1-910b-ubuntu22.04-py3.10
90100
env:
91101
HF_ENDPOINT: https://hf-mirror.com
92102
HF_TOKEN: ${{ secrets.HF_TOKEN }}
93103
DATASET_SOURCE: ModelScope
94104
VLLM_USE_MODELSCOPE: True
105+
# Please also update this when bump matched version
106+
GHA_VLLM_VERSION: ${{ github.event.inputs.vllm-version || 'v0.9.0' }}
107+
# 1. If version specified (work_dispatch), do specified branch accuracy test
108+
# 2. If no version (labeled PR), do accuracy test by default ref:
109+
# The branch, tag or SHA to checkout. When checking out the repository that
110+
# triggered a workflow, this defaults to the reference or SHA for that event.
111+
# Otherwise, uses the default branch.
112+
GHA_VLLM_ASCEND_VERSION: ${{ github.event.inputs.vllm-ascend-version }}
95113

96114
steps:
97115
- name: Checkout repository
@@ -120,8 +138,7 @@ jobs:
120138
with:
121139
repository: vllm-project/vllm
122140
path: ./vllm-empty
123-
# Please also change this when bump matched version
124-
ref: ${{ github.event.inputs.vllm-version || 'v0.9.0' }}
141+
ref: ${{ env.GHA_VLLM_VERSION }}
125142

126143
- name: Install vllm-project/vllm from source
127144
working-directory: ./vllm-empty
@@ -132,9 +149,7 @@ jobs:
132149
with:
133150
repository: vllm-project/vllm-ascend
134151
path: ./vllm-ascend
135-
# 1. If version specified (work_dispatch), do specified branch test
136-
# 2. If no version (labeled PR), do PR accuracy test
137-
ref: ${{ github.event.inputs.vllm-ascend-version }}
152+
ref: ${{ env.GHA_VLLM_ASCEND_VERSION }}
138153
fetch-depth: 0
139154

140155
- name: Install vllm-project/vllm-ascend
@@ -157,23 +172,24 @@ jobs:
157172
fi
158173
done
159174
INFO_FILE="/usr/local/Ascend/ascend-toolkit/${TOOLKIT_DIR}/$(uname -i)-linux/ascend_toolkit_install.info"
160-
CANN_VERSION=$(grep "version=" "$INFO_FILE" \
175+
GHA_CANN_VERSION=$(grep "version=" "$INFO_FILE" \
161176
| head -n1 \
162177
| cut -d'=' -f2 \
163178
| tr -d '"')
164179
{
165-
echo "CANN_VERSION=$CANN_VERSION"
166-
pip show torch | grep "Version:" | awk '{print "TORCH_VERSION="$2}'
167-
pip show torch_npu | grep "Version:" | awk '{print "TORCH_NPU_VERSION="$2}'
168-
pip show vllm | grep "Version:" | awk '{print "VLLM_VERSION="$2}' | sed 's/+.*//'
180+
echo "GHA_CANN_VERSION=$GHA_CANN_VERSION"
181+
pip show torch | grep "Version:" | awk '{print "GHA_TORCH_VERSION="$2}'
182+
pip show torch_npu | grep "Version:" | awk '{print "GHA_TORCH_NPU_VERSION="$2}'
183+
pip show vllm | grep "Version:" | awk '{print "GHA_VLLM_VERSION="$2}' | sed 's/+.*//'
169184
} >> "$GITHUB_ENV"
170185
171186
- name: Print versions
172187
run: |
173-
echo "CANN: ${{ env.CANN_VERSION }}"
174-
echo "Torch NPU: ${{ env.TORCH_NPU_VERSION }}"
175-
echo "Torch: ${{ env.TORCH_VERSION }}"
176-
echo "vLLM: ${{ env.VLLM_VERSION }}"
188+
echo "CANN: ${{ env.GHA_CANN_VERSION }}"
189+
echo "Torch NPU: ${{ env.GHA_TORCH_NPU_VERSION }}"
190+
echo "Torch: ${{ env.GHA_TORCH_VERSION }}"
191+
echo "vLLM: ${{ env.GHA_VLLM_VERSION }}"
192+
echo "vLLM Ascend: ${{ env.GHA_VLLM_ASCEND_VERSION }}"
177193
178194
- name: Run Accuracy Test for V0
179195
id: report
@@ -186,21 +202,22 @@ jobs:
186202
echo "model_base_name=$model_base_name"
187203
echo "model_base_name=$model_base_name" >> $GITHUB_OUTPUT
188204
mkdir -p ./accuracy/V0
189-
echo "test111" > ./accuracy/V0/${model_base_name}.md
205+
190206
python ./scripts/run_accuracy.py \
191207
--model "${{ matrix.model_name }}" \
192208
--output "./accuracy/V0/${model_base_name}.md" \
193-
--vllm_ascend_version "${{ github.event.inputs.vllm-ascend-version || 'current' }}" \
194-
--cann_version "${{ env.CANN_VERSION }}" \
195-
--torch_npu_version "${{ env.TORCH_NPU_VERSION }}" \
196-
--torch_version "${{ env.TORCH_VERSION }}" \
197-
--vllm_version "${{ env.VLLM_VERSION }}"
198-
cat ./accuracy/V0/${model_base_name}.md
209+
--vllm_ascend_version "${{ env.GHA_VLLM_ASCEND_VERSION || github.ref }}" \
210+
--cann_version "${{ env.GHA_CANN_VERSION }}" \
211+
--torch_npu_version "${{ env.GHA_TORCH_NPU_VERSION }}" \
212+
--torch_version "${{ env.GHA_TORCH_VERSION }}" \
213+
--vllm_version "${{ env.GHA_VLLM_VERSION }}"
214+
215+
cat ./accuracy/V0/${model_base_name}.md >> $GITHUB_STEP_SUMMARY
199216
200217
- name: Upload Report for V0
201218
uses: actions/upload-artifact@v4
202219
with:
203-
name: "${{ github.event.inputs.vllm-ascend-version }}-${{ steps.report.outputs.model_base_name }}-V0-report"
220+
name: "${{ env.GHA_VLLM_ASCEND_VERSION }}-${{ steps.report.outputs.model_base_name }}-V0-report"
204221
path: ./benchmarks/accuracy/V0/${{ steps.report.outputs.model_base_name }}.md
205222
if-no-files-found: warn
206223
retention-days: 90

benchmarks/scripts/run_accuracy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def generate_md(model_name, tasks_list, args, datasets):
110110
run_cmd = MODEL_RUN_INFO[model_name].format(model=model_name,
111111
datasets=datasets)
112112
model = model_name.split("/")[1]
113-
preamble = f"""# {model} Accuracy Test
113+
preamble = f"""# 🎯 {model} Accuracy Test
114114
<div>
115115
<strong>vLLM version:</strong> vLLM: {args.vllm_version}, vLLM Ascend: {args.vllm_ascend_version} <br>
116116
</div>

0 commit comments

Comments
 (0)