ci: targeted PR tests, runtime summary, and config-consistency check#802
Merged
Conversation
214e460 to
7aee925
Compare
cb8589e to
189e99f
Compare
Fail CI when ci.yaml's BASE_IMAGE and the Dockerfile's ARG default drift, or when primus.__version__ is not a valid PEP 440 version.
Render per-job stage wall-clock (aiter, primus-turbo) as a Markdown table next to the test/coverage summaries, complementing junit test time.
Map a PR's changed files to the minimal tests/unit_tests paths in the torch job; fail-safe to the full suite on shared/unknown/CI changes. Other events and the CLI/E2E/model tests are unchanged. Unit-tested.
189e99f to
1992775
Compare
tests/unit_tests/tools/test_utils.py and
tests/unit_tests/core/patches/test_utils.py share a basename. With no
__init__.py in the tests tree, pytest maps both to module `test_utils` and
aborts collection ("import file mismatch"). Rename to test_tools_utils.py so
component-scoped PR test selection can run the tools tests cleanly.
1992775 to
1b90be8
Compare
Beyond BASE_IMAGE/__version__, also fail on: pyproject runtime deps not matching requirements.txt (requirements may add dev/CI-only extras), any workflow action not pinned to a 40-hex SHA, and workflow python-version disagreeing or below requires-python.
fed6b15 to
6feb249
Compare
Unify unit + E2E selection behind one classify(): GLOBAL_TRIGGERS is the only hard-coded list (whole-repo blast radius incl. runner/); unit dirs are resolved by source-tree convention (primus/<x> -> tests/unit_tests/<x>, nearest existing dir); E2E suites are auto-discovered from tests/trainer/test_<name>_trainer.py; a backend is named by its dir (primus/backends/<X> or examples/<X>). Fail-safe is the only invariant -- anything global, unlocatable, or a backend without a trainer expands to everything, so it over-selects, never under-selects. The torch/jax jobs gate each model-test step on --e2e; push/release/dispatch are unaffected. Unit-tested.
6feb249 to
5002267
Compare
Xiaoming-AMD
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Additive, fail-safe CI/CD improvements. Fail-safe is the only invariant: every
selection can over-select but never under-select, and push/release/dispatch
always run everything (main's coverage baseline is unaffected).
Cross-file config consistency check (
tools/ci/check_version_consistency.py)Runs in the lint job; fails on drift between duplicated values:
ci.yamlBASE_IMAGEvs the DockerfileARG BASE_IMAGEdefault;primus.__version__not valid PEP 440;requirements.txt(requirements may add dev/CI-only extras);
uses:not pinned to a 40-hex commit SHA (floating-tag guard);python-versions disagreeing or belowrequires-python.Per-job CI runtime summary (
tools/ci/runtime_summary.py)Build/install timers (aiter, primus-turbo) append
stage<TAB>secondsto$RUNNER_TEMP/runtime.tsv, rendered as a Markdown table next to thetest/coverage summaries in the torch and jax jobs (complements junit, which
only reports test time).
Change-aware test selection (
tools/ci/select_tests.py)On
pull_request, a singleclassify(path)decides each changed file's blastradius; both unit and E2E selection build on it.
primus/<x>->tests/unit_tests/<x>, resolved to the nearest existing dir); a backend mapsto
tests/unit_tests/backends/<X>/. Anything unlocatable (non-.pyunderprimus/, a backend with no unit dir, etc.) falls back to the full suite.tests/trainer/test_<name>_trainer.py(adding a trainer wires it in automatically). A backend change runs that
backend's suite; a backend without a trainer, a non-backend source change,
runner/, or anything global runs all E2E. The torch/jax jobs gate eachmodel-test step on it.
GLOBAL_TRIGGERS(whole-repo blast radius);everything else is convention + auto-discovery, and being unlisted only ever
falls back to "run more".
Unit-tested in
tests/unit_tests/ci/test_select_tests.py.