You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
CI: Extract L4/L5 GPU jobs into reusable workflows and wire detect-affected (#185)
## Summary
Refactors the CI pipeline to eliminate duplicate GPU runs, fix an
`onnxruntime-gpu` install-order bug, and connect GPU test jobs to the
`detect-affected` model detection system for PR-scoped test runs. Also
simplifies L3 filtering to use `--models` instead of `-k` for exact
`model_type` matching.
## Changes
### `gpu_l4_golden_parity.yml`
- Removed `push` trigger to `main` (was causing duplicate runs alongside
`main.yml`'s `workflow_call`)
- Kept `schedule` (nightly at 4am UTC), `workflow_dispatch`, and
`workflow_call` triggers
- Added golden-data presence check (`check_golden` step) to skip
gracefully when no `.json` files exist
- Added affected-model filtering: scopes to `--models` on PRs, runs all
on nightly/dispatch
- Handles pytest exit code 5 (no matching tests) without failing the job
- Conditional Codecov upload and artifact upload gated on `has_golden`
### `gpu_l5_generation_e2e.yml`
- Removed `push` trigger to `main` (same duplicate-run fix as L4)
- Kept `schedule` (nightly at 5am UTC), `workflow_dispatch`, and
`workflow_call` triggers
- Added affected-model filtering with the same `--models` flag and
exit-code-5 handling
### `validation_examples_gpu.yml`
- Fixed `onnxruntime-gpu` being overwritten by CPU `onnxruntime`: the
`ort-genai` extra transitively depends on `onnxruntime` (CPU), which was
installed *after* `onnxruntime-gpu`, replacing it
- Moved `pip install onnxruntime-gpu` after the editable install so the
GPU package wins
### `main.yml`
- Replaced inlined L4 golden-comparison job with `uses:
./.github/workflows/gpu_l4_golden_parity.yml`
- Added new L5 generation-e2e job delegating to
`gpu_l5_generation_e2e.yml`
- Both jobs depend on `detect-affected` and pass `affected_models`
output
- Added `needs.detect-affected.result == 'failure'` safety fallback to
L4 and L5 conditions — if detection errors out, GPU tests run all models
rather than being silently skipped
- L3 synthetic parity: replaced `-k` substring filtering with `--models`
for exact `model_type` matching
## Behavior
| Trigger | L3 | L4 | L5 |
|---|---|---|---|
| PR with affected models | Runs scoped to affected models | Runs scoped
to affected models | Runs scoped to affected models |
| PR with no affected models | Skipped | Skipped | Skipped |
| PR where `detect-affected` fails | Runs all (safety fallback) | Runs
all (safety fallback) | Runs all (safety fallback) |
| Push to main | Runs all | Runs all (via `main.yml`) | Runs all (via
`main.yml`) |
| Nightly schedule | N/A | Runs all (standalone) | Runs all (standalone)
|
| Manual dispatch | Runs all | Runs all | Runs all |
## Bug fix
**`validation_examples_gpu.yml` — `CUDAExecutionProvider` unavailable.**
The `ort-genai` pip extra pulls in `onnxruntime` (CPU), which overwrote
the previously installed `onnxruntime-gpu`. This caused GPU example
validation (e.g. `nemotron_3_nano_text_generation`) to silently fall
back to CPU-only execution and fail. Fixed by reordering the install so
`onnxruntime-gpu` is installed last.
---------
Signed-off-by: Tommaso Adani <83273681+tadani3@users.noreply.github.com>
Co-authored-by: Tommaso Adani <tommasoadani@microsoft.com>
Co-authored-by: Copilot <copilot@github.com>
0 commit comments