-
Notifications
You must be signed in to change notification settings - Fork 6
351 lines (338 loc) · 13 KB
/
Copy pathmain.yml
File metadata and controls
351 lines (338 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
name: CI
permissions:
contents: read
on:
push:
branches: [ "main" ]
tags:
- v*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python "3.13"
uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Lint with lintrunner
uses: justinchuby/lintrunner-action@main
detect-affected:
name: Detect affected models
runs-on: ubuntu-latest
outputs:
affected: ${{ steps.detect.outputs.affected }}
golden_l4_cases: ${{ steps.detect.outputs.golden_l4_cases }}
golden_l5_cases: ${{ steps.detect.outputs.golden_l5_cases }}
run_all: ${{ steps.detect.outputs.run_all }}
has_affected: ${{ steps.detect.outputs.has_affected }}
has_l4_affected: ${{ steps.detect.outputs.has_l4_affected }}
has_l5_affected: ${{ steps.detect.outputs.has_l5_affected }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Get changed files
id: changed
env:
BASE_REF: ${{ github.base_ref }}
BEFORE: ${{ github.event.before }}
SHA: ${{ github.sha }}
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
git diff --name-only origin/"$BASE_REF"...HEAD > changed_files.txt
elif [ "${{ github.event_name }}" = "push" ] && \
[ -n "$BEFORE" ] && \
[ "$BEFORE" != "0000000000000000000000000000000000000000" ]; then
# Push with a known previous commit: use the full push range so
# multi-commit pushes don't silently miss changed files.
git diff --name-only "$BEFORE"..."$SHA" > changed_files.txt
else
# workflow_dispatch, new-branch push (before=0000...), or unknown
# event: fall back to HEAD~1 when it exists, or diff-tree for the
# root commit of a new repository.
if git rev-parse --verify HEAD~1 >/dev/null 2>&1; then
git diff --name-only HEAD~1...HEAD > changed_files.txt
else
git diff-tree --root --no-commit-id --name-only -r HEAD > changed_files.txt
fi
fi
echo "Changed files:"
cat changed_files.txt
- name: Detect affected models
id: detect
run: |
output=$(python scripts/detect_affected_models.py \
--stdin --output-format github < changed_files.txt)
echo "$output"
echo "$output" >> "$GITHUB_OUTPUT"
smoke-test:
name: L1 Smoke Test
runs-on: ubuntu-latest
needs: [detect-affected]
if: always() && !cancelled()
steps:
- uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Cache pip packages
uses: actions/cache@v6
with:
path: ~/.cache/pip
key: pip-smoke-${{ hashFiles('pyproject.toml', 'requirements/ci/requirements.txt') }}
restore-keys: |
pip-smoke-
- name: Install PyTorch CPU
run: pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install dependencies
run: |
pip install -r requirements/ci/requirements.txt
pip install onnxruntime
pip install -e '.[testing]'
- name: Run L1 smoke tests (all model configs)
run: |
pytest tests/build_graph -v --tb=short -n auto \
--cov=src --cov-report=xml --cov-branch --junitxml junit.xml
timeout-minutes: 10
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: smoke
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: smoke
report-type: test_results
synthetic-parity:
name: L3 Synthetic Parity
runs-on: ubuntu-latest
needs: [detect-affected]
if: >-
always() && !cancelled() &&
(needs.detect-affected.result == 'failure' ||
needs.detect-affected.outputs.has_l4_affected == 'true')
steps:
- uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Cache pip packages
uses: actions/cache@v6
with:
path: ~/.cache/pip
key: pip-parity-${{ hashFiles('pyproject.toml', 'requirements/ci/requirements.txt') }}
restore-keys: |
pip-parity-
- name: Install PyTorch CPU
run: pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install dependencies
run: |
pip install -r requirements/ci/requirements.txt
pip install onnxruntime
pip install -e '.[testing,transformers]'
pip install --force-reinstall --no-deps -r requirements/ci/vibevoice.txt
- name: Run L3 synthetic parity tests
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
if [ ! -f tests/synthetic_parity_test.py ]; then
echo "tests/synthetic_parity_test.py not found — skipping"
exit 0
fi
if [ "${{ needs.detect-affected.result }}" = "failure" ] || \
[ "${{ needs.detect-affected.outputs.run_all }}" = "true" ]; then
echo "Running all synthetic parity tests"
pytest tests/synthetic_parity_test.py -v --tb=short -n auto \
--cov=src --cov-report=xml --cov-branch --junitxml junit.xml
else
AFFECTED='${{ needs.detect-affected.outputs.affected }}'
echo "Running parity for affected models: $AFFECTED"
MODELS=$(echo "$AFFECTED" | python -c "import json, sys; print(','.join(json.load(sys.stdin)))")
if [ -n "$MODELS" ]; then
pytest tests/synthetic_parity_test.py -v --tb=short -n auto --models "$MODELS" \
--cov=src --cov-report=xml --cov-branch --junitxml junit.xml
else
echo "No affected models — skipping"
fi
fi
timeout-minutes: 20
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: synthetic-parity
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: synthetic-parity
report-type: test_results
golden-comparison:
name: L4 Golden Comparison
needs: [detect-affected]
if: >-
always() && !cancelled() &&
(needs.detect-affected.result == 'failure' ||
needs.detect-affected.outputs.has_l4_affected == 'true')
uses: ./.github/workflows/gpu_l4_golden_parity.yml
with:
affected_models: ${{ needs.detect-affected.outputs.affected }}
affected_cases: ${{ needs.detect-affected.outputs.golden_l4_cases }}
secrets:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
generation-e2e:
name: L5 Generation E2E
needs: [detect-affected]
if: >-
always() && !cancelled() &&
(needs.detect-affected.result == 'failure' ||
needs.detect-affected.outputs.has_l5_affected == 'true')
uses: ./.github/workflows/gpu_l5_generation_e2e.yml
with:
affected_models: ${{ needs.detect-affected.outputs.affected }}
affected_cases: ${{ needs.detect-affected.outputs.golden_l5_cases }}
secrets:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
ort-genai-e2e:
name: ORT GenAI E2E
needs: [detect-affected]
if: >-
always() && !cancelled() &&
(needs.detect-affected.result == 'failure' ||
needs.detect-affected.outputs.has_affected == 'true')
uses: ./.github/workflows/ort_genai_e2e.yml
with:
run_real: false
test:
name: test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python_version: ["3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python_version }}
- name: Cache pip packages
uses: actions/cache@v6
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ matrix.python_version }}-${{ hashFiles('pyproject.toml', 'requirements/ci/requirements.txt') }}
restore-keys: |
pip-${{ runner.os }}-${{ matrix.python_version }}-
- name: Install PyTorch CPU
run: pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Install dependencies
run: |
pip install -r requirements/ci/requirements.txt
pip install onnxruntime
pip install -e '.[testing]'
pip install --force-reinstall --no-deps -r requirements/ci/vibevoice.txt
- name: Run tests
run: |
pytest -n auto -m 'not integration and not arch_validation' --cov=src --cov-report=xml --cov-branch --junitxml junit.xml
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
report-type: test_results
integration-fast:
name: Integration (fast)
runs-on:
- self-hosted
- "1ES.Pool=onnxruntime-ep-mobius-github-linux-a10"
- "JobId=gpu-integration-fast-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"
steps:
- uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Cache HuggingFace models
uses: actions/cache@v6
with:
path: ~/.cache/huggingface
key: hf-integration-fast-${{ hashFiles('tests/integration/_support.py', 'tests/integration/text_test.py', 'tests/integration/generation_test.py', 'tests/integration/encoder_media_seq2seq_test.py', 'tests/integration/architectures_test.py', 'tests/integration/qwen3_5_vl_test.py', 'tests/gguf_small_model_runtime_integration_test.py') }}
restore-keys: |
hf-integration-fast-
- name: Install PyTorch CUDA
run: pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
- name: Install dependencies
run: |
pip install -r requirements/ci/requirements.txt
pip install soundfile librosa ml_dtypes flatbuffers numpy packaging protobuf sympy coloredlogs
pip install -e '.[testing]'
# PyPI's ORT 1.27+ wheel requires CUDA 13, while these runners use CUDA 12.
pip install --pre --no-deps --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ onnxruntime-gpu
pip install --no-deps onnxruntime-genai-cuda
- name: Run fast integration tests
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
pytest tests/integration/text_test.py tests/integration/generation_test.py \
tests/integration/encoder_media_seq2seq_test.py \
tests/integration/architectures_test.py \
tests/integration/qwen3_5_vl_test.py \
tests/gguf_small_model_runtime_integration_test.py -m integration_fast -v \
-k "smollm-135m or smollm2-135m-instruct-f16 or albert-base or t5-small or dinov2-small or wav2vec2-base or whisper-tiny or test_gemma3_multimodal or test_qwen35 or test_qwen3_next or test_deepseek or test_sam_vit or test_ocr2" \
--cov=src --cov-report=xml --cov-branch --junitxml junit.xml
timeout-minutes: 15
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: integration
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: integration
report-type: test_results
build:
name: Build
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install Python build dependencies
run: |
pip install build wheel
- name: Build wheels
run: |
python -m build