Repository navigation
Backend CI: split the g-r pytest shard into g-l and m-r - #17187
Conversation
g-r's parallel step took 955-1433 s on main and hit the 1500 s backstop on staging runs on 2026-11-09. Per-letter progress timestamps from four g-r logs put about 40% of its time in g-l and 60% in m-r. rest stays the remainder, and the shard test now checks every first letter maps to exactly one shard.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
In the new g-l shard no earlier file in the worker stubs unsloth, so the real package is imported and raises ImportError (not ModuleNotFoundError) for the missing unsloth_zoo. pytest 9 importorskip only skips ModuleNotFoundError by default, so pass exc_type=ImportError. [skip ci]
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The g-r split adds a fourth backend pytest shard, so the command scan now sees fourteen parallel runs (four backend shards and ten repo-cpu shards).
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
[skip ci]
## Summary The Backend CI `(Python 3.13, a-f)` shard is now running into its `timeout --signal=INT --kill-after=60 1500` backstop. On #17694 (a Studio download-registry change) the parallel step was killed with exit 124 after `30296 passed ... in 1509.42s`, before it finished. Its other recent runs took 1000 to 1340 s, so any slower runner tips it over. This is the same situation as a-k on 2026-10-23 and g-r on 2026-11-09, and it gets the same fix: split the shard, leave the timeout alone (it is a hang backstop, not a budget). ## How the split point was chosen Same method as #17187: the `-q` progress lines carry timestamps, and xdist hands out tests roughly in collection order, so I mapped the progress percentage onto the per-file collection order of a-f. Across five a-f logs (four complete, one killed): | boundary | share of a-f time | | --- | --- | | through `test_c*` | 0.26 to 0.29 | | `test_diffusion*` starts | 0.32 to 0.38 | | `test_diffusion*` ends | 0.93 to 0.94 | `test_d*` alone is about 65% of the shard and nearly all of it is `test_diffusion*` (about 60%). No first letter split comes close to even, so `test_diffusion*` gets its own shard: roughly 40% stays in a-f and 60% moves. ## Changes - `.github/workflows/studio-backend-ci.yml`: - `a-f` also ignores `tests/test_diffusion*.py`. - New `diffusion` shard, rooted at `tests/` like the others (so the shared `--ignore=` list still applies). It excludes everything but `test_diffusion*` one letter at a time, so `test_diffusers*` (and any other `test_d*` file) stays in `a-f`. - `rest` is unchanged and still the remainder. - The serial and decision-training steps stay pinned to `a-f`. The `(Python 3.13, a-f)` check keeps its name. - `tests/test_ci_backend_pytest_shards.py`: new-file examples for the boundary (`test_dog`, `test_diffusers_new`, `test_diffuse` land in `a-f`; `test_diffusion_new`, `test_diffusion` land in `diffusion`). ## Testing - `pytest tests/test_ci_backend_pytest_shards.py`: 59 passed. - Sabotage: without the `test_diffusion*` ignore on `a-f`, 3 tests fail (files run twice). Without the `test_diffus[!i]*` step, the same 3 fail (`test_diffusers*` would run in both shards). - `pytest --collect-only` with the CI selection and shared ignores: old a-f collects 38267 tests, new a-f 16230 and diffusion 22037. The two are disjoint and their union is identical to the old a-f node IDs.
Summary
The Backend CI
(Python 3.13, g-r)shard is running into itstimeout --signal=INT --kill-after=60 1500backstop. Its parallel pytest step took 955 s and 1433 s on the two most recent green main runs, and on 2026-11-09 two staging runs of unrelated PRs were killed with exit 124 (one after36333 passed ... in 1509.28s, one during xdist teardown).This splits g-r into
g-landm-r, the same way a-k / l-r became a-f / g-r on 2026-10-23. The timeout is left alone, since it is a hang backstop and not a budget.How the split point was chosen
The
-qprogress lines in the job logs carry timestamps, and xdist hands out tests roughly in collection order. So I mapped each line's cumulative test count onto the per-file collection order and read off the elapsed time at each letter boundary. Across four g-r logs (two main, two staging):test_m*alone is about 30% of the shard, so g-l / m-r (about 40 / 60) is the most even split on a first letter. g-m / n-r would be about 67 / 33.Changes
.github/workflows/studio-backend-ci.yml: theg-rmatrix entry becomesg-l(--ignore-glob=tests/test_[!g-l]*.py) andm-r(--ignore-glob=tests/test_[!m-r]*.py).restkeeps--ignore-glob=tests/test_[a-r]*.py, so it is still the remainder and new files still land in exactly one shard. The comment records the history.tests/test_ci_backend_pytest_shards.py: the new-file examples now cover both new ranges, and a new parametrized test checks that every lowercase first letter is claimed by exactly one shard.The serial and decision-training steps stay pinned to
a-f. No required status check names the oldg-rshard.Testing
pytest tests/test_ci_backend_pytest_shards.py: 54 passed. Changingg-ltog-kmakes 3 tests fail (the l files are dropped), so the guard still catches gaps.pytest --collect-onlywith the CI selection: g-r collects 37225 tests, g-l 14324 and m-r 22901. The union of g-l and m-r is identical to g-r's node IDs.