Skip to content

ci: route PR CI by test group, down to the test step - #970

Merged
jhchouuu merged 3 commits into
mainfrom
jiahzhou/ci-scope-paths
Nov 10, 2026
Merged

jhchouuu merged 3 commits into
mainfrom
jiahzhou/ci-scope-paths

Conversation

@jhchouuu

@jhchouuu jhchouuu commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #947; follows #948.

#948 picks whole lanes from the changed files, and any path it does not recognize runs every lane. This PR routes PR CI by test group: each changed file maps to the groups whose tests depend on it. A job runs only if one of its groups is selected, and inside a job a test step runs only if its own group is selected.

Test groups

group what runs
ep the EP v1 steps of the intranode and internode jobs (MI355X, MI300X); the ROCm 10 and JAX jobs
kiwi the KIWI-EP steps (intranode, internode EP16), which run only in the MI300X jobs
ccl the MORI-CCL steps
io the MORI-IO steps (Python, C++ engine, fault catalogs, internode sweeps)
ras MORI-RAS C++
shmem MORI-IR and the shmem tests and benchmarks
umbp the UMBP unit test job
cco the CCO steps of the CCO unit test: unit, SDMA, examples, SymmetricMemory, Triton, FlyDSL buffer, import order
epv2 the EPv2 and JIT v2 steps of the CCO unit test; the CCO EPv2 single-node and CCO internode jobs
fused the CCO fused GEMM job
build the MI355X build job only (examples CI builds but does not run)

Jobs and the groups that start them:

job groups
MI355X intranode ep, ccl, io, ras, shmem
MI355X ROCm 10, MI355X JAX ep
MI355X internode ep, ccl, io
MI300X intranode ep, kiwi, ccl, io, ras, shmem
MI300X internode ep, kiwi, ccl, io
UMBP unit test umbp
CCO unit test cco, epv2
CCO EPv2 single-node test, CCO internode epv2
CCO fused GEMM test fused
MoRI build (compile check) any group except fused alone

In the jobs that serve several groups, each test step has if: contains(fromJSON(...groups), '<group>'). Setup and cleanup steps always run.

The lanes are derived from the groups: mori (MI355X) is any of ep, ccl, io, ras, shmem; cco is cco or epv2. mi300x is any of those or kiwi, and as before only when the change touches MI300X_PATHS. ci:mi300x with none of the MI300X groups selected runs the MI300X jobs with all their groups and leaves the MI355X jobs off.

The scope outputs the groups as a JSON list (groups) and a build flag. ci_cco.yml takes groups instead of the cco/fused booleans. The routing comment lists the jobs that run in each lane and the selected groups.

How a file maps to groups

The rules in ci_scope.py (first match wins) come from a scan of the whole repo:

  • a CMake/Ninja build in the CI image, for the sources and headers each test target compiles;
  • the import closure of every Python test;
  • the kernel sources the JIT tests compile;
  • the files tests read at run time.

Shared code counts for every group that uses it:

code groups
cco (src/cco, include/mori/cco, python/mori/cco) cco, epv2, fused
IO and RAS (src/io, src/ras, python/mori/io) io, ccl, ras, umbp
shmem (src/shmem, python/mori/shmem, python/mori/ir) shmem, ep, kiwi, ccl, cco, epv2, io
EP Python shared by v1 and v2 (ops/__init__.py, utils.py, dispatch_combine.py) ep, kiwi, epv2, fused
src/jit, jit/v2, dispatch_combine_v2 epv2
src/metrics umbp
anything no rule names (e.g. src/application, include/mori/core, build files, ci.yml) all

A file that a group's tests only link or import at load time counts for the group that owns it. If such a file breaks, the owning group's tests fail too.

Files that tests of another group read at run time count for that group as well:

  • The UMBP lazy-load test. test_umbp_lazy_load checks what import mori.ops, mori.io, mori.shmem loads. Every module those imports run counts for umbp too. The scope computes this import closure from the PR's checkout.
  • examples/umbp/multi_backend_policy.json. A UMBP C++ test reads it.
  • examples/cco/python/cco_example_common.py. The EPv2 tests import it.
  • tests/python/cco/__init__.py. The fused GEMM tests run it.

Paths that no longer run every lane:

path groups
tools/ files that PR CI does not run, build or import (tuning, perf, profiler and docs scripts, build_manylinux_wheel.py, ...) none
.clang-format, .typos.toml, CPPLINT.cfg, .pre-commit-config.yaml, tools/codestyle/ (only pre-commit reads them) none
examples CI neither builds nor runs (fsdp_sdma, torch_symm_all2all, monitoring, io, cco Python 03/06/09/11/12) none
tests/cpp/jit/, tools/jit_v2/ epv2
tests/cpp/ras/ ras
KIWI kiwi
EP v1 sources, tuning tables, tests/python/ops (v1), examples/ops ep, kiwi

How a tools/ file is decided

  • When it counts. A tools/ file counts when a PR CI entry point names it, or when a counted tools/ file does.
    • The entry points are ci.yml, ci_cco.yml, the docker/ files they use, setup.py, pyproject.toml, any CMakeLists.txt, cmake/ and python/mori.
    • Example chain: setup.py → setup_spdk.sh → umbp_spdk_preflight.sh.
  • The scripts CI runs. These map to the groups of the jobs that run them. For example, run_internode_test.sh maps to ep, kiwi, epv2, and run_cco_tests.sh to cco. Any other counted file is classified like any other path.
  • New scripts. A new script starts no GPU CI until CI uses it. The scan reads the PR's own checkout, so a PR that starts running a script is routed by that use.
  • The scope job's checkout. Its sparse checkout includes these files and python/mori: 251 of the repo's 1301 files. Without them, every tools/ file counts and every python/mori module counts for umbp.

Effect

Replayed over the 191 PRs merged since 2026-09-08 and the 93 open PRs, using per-step median durations from past runs:

  • Average GPU-job time per PR: 67.3 min under ci: run only the GPU lanes a PR's changes need; move the CCO unit test to PIT-G17 #948, 55.2 min here (−18%). No PR runs more.
  • Typical PR: the median PR saves 2%, because most PRs touch shared code.
  • Focused PRs: a quarter of PRs save 32% or more, and 40 save more than half. For example, a RAS-only PR runs the MI355X/MI300X intranode jobs with only the RAS step, plus the build. A KIWI-only PR runs the MI300X jobs with only the KIWI steps, plus the build. An EPv2-only PR runs only the EPv2 steps and jobs.

python3 .github/scripts/ci_scope.py --files <list> prints the lanes and groups for a file list.

🤖 Generated with Claude Code

- a tools/ file counts only if PR CI runs, builds or imports it, found by
  scanning the CI entry files; any other tools/ file starts no GPU lane
- lint and style configs start no GPU lane
- tests/cpp/jit and tools/jit_v2 run the cco lane; RAS runs the IO lanes;
  KIWI and the EP v1 tuning tables, tests and examples run mori (+ MI300X)
- the scope job checks out the files the scan reads

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

GPU CI for 32be295b (run): changed areas: ci, ci_cco

lane runs jobs
mori yes MI355X intranode, MI355X ROCm 10, MI355X JAX, MI355X internode
mi300x yes MI300X intranode, MI300X internode
umbp yes UMBP unit test
cco yes CCO unit test, CCO EPv2 single-node test, CCO internode
fused yes CCO fused GEMM test
build yes MoRI build (compile check)

Test groups (the steps that run in those jobs): ep, kiwi, ccl, io, ras, shmem, umbp, cco, epv2, fused, build.

Lanes follow the changed files. Adding ci:full re-runs CI with every lane and the full internode sweeps; adding ci:mi300x re-runs it with the MI300X lanes added. /ci-rerun re-runs CI against the current main.

- ci_scope.py maps each changed file to test groups (ep, kiwi, ccl, io, ras, shmem, umbp, cco, epv2, fused, build); the lanes follow the groups
- Jobs and test steps in ci.yml and ci_cco.yml run only for their groups; ci_cco.yml takes the group list
- Files that tests read at run time count for those tests: the modules test_umbp_lazy_load imports, examples/umbp/multi_backend_policy.json, cco_example_common.py
- The routing comment lists the jobs that run and the test groups
- ci:mi300x alone runs the MI300X jobs with all their groups, not the MI355X lane

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jhchouuu jhchouuu changed the title ci: route tools/, RAS, KIWI and EP v1 paths by what PR CI runs ci: route PR CI by test group, down to the test step Nov 10, 2026
- KIWI steps run only in the MI300X jobs (build_ops_kiwi), so the kiwi group no longer starts the MI355X intranode and internode jobs
- A KIWI-only change runs the MI300X jobs and the MI355X build job, which compile-checks KIWI

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jhchouuu
jhchouuu merged commit 78b94e4 into main Nov 10, 2026
8 of 12 checks passed
@jhchouuu
jhchouuu deleted the jiahzhou/ci-scope-paths branch November 10, 2026 09:39
QizhouZhang97 added a commit that referenced this pull request Nov 10, 2026
- cco-fused-test stays on MI355X-AINIC: after #948 and #970 PIT-G17 is as
  busy, and the speedup alone shortens PR waits more than the move does
- tp8-blockscale runs on every PR again: TP8 is the only blockscale shape
  wo_b has fitted plans for
- test_a2a_gemm keeps acquire="none", the README's variant, on PRs; "inv",
  the op's default that test_a2a_gemm_op.py runs, moves to ci:full
- the steps that pick GEMM+AR / GEMM+AG tests by mark share one file list,
  so a mark alone decides which step runs a test
- pytest-xdist is installed by docker/Dockerfile.dev, not at run time

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant