Repository navigation
Backend CI: run the multi-rank gloo suites in their own Repo tests shard - #15291
Conversation
Repo tests (CPU, rest) has been hitting its 2100 s pytest cap: on most runs today pytest got SIGINT and stopped at 74 to 98%, so the tail of the shard never ran, and with the other reds now fixed the shard fails on the timeout alone (exit 124). The new tensor, pipeline and context parallel, float8 and fp8 gloo suites spawn 2 to 4 ranks per test, as the FSDP2 ones did before they got the fsdp2 shard: on 4 cores they are 578 s of the catch-all's 1258 s. A gloo shard takes every *gloo* file except test_fs* (fsdp2's), written as two globs because an explicit file root cannot be filtered by --ignore, and rest ignores the same two globs. The collected ids are unchanged: 17751 in the old rest = 17666 in the new rest + 85 in gloo, none shared with fsdp2.
|
@codex review |
Codex Review SummaryThis 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. You're on a roll. 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". |
test_the_command_scan_sees_the_parallel_run_and_the_serial_steps pins how many parallel pytest runs the workflow has, so that a shard added or removed is stated rather than silently covered by fewer checks. The gloo shard makes it eight parallel runs, five of them repo-cpu-tests shards.
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 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". |
`Repo tests (CPU, fsdp2)` on #15833's staging run passed every test and still went red: ``` 364 passed, 28 skipped, 80 warnings in 2092.29s (0:34:52) ##[error]Process completed with exit code 124. ``` The shard's pytest step runs under `timeout --signal=INT --kill-after=60 2100`. pytest finished 8 s under that cap, and the cap then fired while it was exiting. ## Cause #15291 moved the FSDP2 gloo tests into their own shard at about ten minutes of runner time. They have grown since, with most of a dozen FSDP2 PRs merged today adding tests there (#15756, #15748, #15720, #15709, #15708, #15352, ...). Over the last twenty-odd staging runs this job took 21 to 38 minutes, so it now sits at its cap on an ordinary runner. Nothing failed; the shard is simply too big for its timeout. ## Fix Split the shard in two by file name, balanced on measured time. Per-test durations on main, summed per file across all 76 files: | shard | selection | files | tests | measured time | |---|---|---|---|---| | `fsdp2` | `tests/test_fsdp2_[!n]*.py tests/test_fsdp2_n[!a]*.py tests/test_fsdp2_native_[abc]*.py` | 34 | 237 | 1156 s (45%) | | `fsdp2-native` (new) | `tests/test_fsdp2_native_[!abc]*.py` | 42 | 276 | 1406 s (55%) | | both together, unchanged total | `tests/test_fsdp2*.py` | 76 | 513 | 2562 s | `fsdp2` keeps its name, so its check name is unchanged. The step timeout and job cap are left alone, so each half gets the whole budget. ## Guards - `tests/test_ci_repo_cpu_shards.py` already fails when a file lands in no shard or in two. It caught my first draft, which dropped `test_fsdp2_non_cuda_accelerate_route.py`; hence the `n[!a]` glob. - A new check, `TestEveryGlobRootMatchesAFile`, fails if a shard glob matches no test file. bash passes an unmatched glob through literally and pytest then fails the whole shard on a missing path. Sabotage: adding `tests/test_fsdp2_zz*.py` to a selection fails it with `[('fsdp2', 'tests/test_fsdp2_zz*.py')]`. - `tests/studio/test_backend_ci_parallel_isolation.py` pins the number of parallel runs, now nine (six repo-root shards). ## Verification - `tests/test_ci_repo_cpu_shards.py` and `tests/studio/test_backend_ci_parallel_isolation.py`: 56 passed. - With `tests/studio/test_cache_budget_discipline.py` added: everything passes except the guard on my first draft, fixed above. - `--collect-only` on the two selections gives 237 + 276 = 513, the same as the old single glob. The per-file times are from a local `-n 8` run, so the split ratio is approximate. The first runs of the two new shards will show the actual runner times.
Repo tests (CPU, rest)has been running out of time. Its pytest step is capped attimeout --signal=INT --kill-after=60 2100.KeyboardInterruptbanner and a reported time of 2090 to 2097 s, stopping between 74% and 98% of the shard.Process completed with exit code 124, at 75%), for example on Decode graphs: release() and invalidate() re-arm a model that a capture failure disabled #15217, Tensor parallel sharded loading: allow init_lora_weights = "orthogonal" #15218 and Fused preference loss: fall back when a global forward hook is registered #15226.Cause
The shard is the catch-all. It has picked up the multi-rank gloo suites added recently: tensor parallel, pipeline parallel, context parallel, float8 and fp8 under FSDP2. Each spawns 2 to 4 ranks per test. This is the same thing that happened with the FSDP2 gloo files, which is why they already have their own
fsdp2shard.Measured locally at this job's shape (
-n 4 --dist loadgroup, pinned to 4 cores, one selection per core set):fsdp2shardSo the gloo files are about 46% of the catch-all. Folding them into
fsdp2would push that shard to the cap instead; its jobs already run 17.5 to 29 minutes on CI.Fix
A
glooshard takes every*gloo*file excepttest_fs*, which arefsdp2's. It is written as two globs,tests/test_[!f]*gloo*.pyandtests/test_f[!s]*gloo*.py, because an explicit file root cannot be filtered with--ignore, as the matrix notes already say.restignores the same two globs. A new multi-rank gloo file lands in the new shard without a workflow edit.This adds a check,
Repo tests (CPU, gloo). No existing check name changes.Verification
tests/studio/test_backend_ci_parallel_isolation.pypins the number of parallel pytest runs; it now expects eight, five of them repo-cpu-tests shards (it failed at seven before that update). It andtests/test_ci_repo_cpu_shards.pytogether: 54 passed.tests/test_ci_repo_cpu_shards.pyon its own: 13 passed. It fails both ways if the split is broken: drop the new shard and its files are reported as dropped; drop therestignores and they are reported as run twice.--collect-onlywith the same shell glob expansion): the oldresthas 17751. The newrest(17666) plusgloo(85) is identical, with nothing in both and nothing shared withfsdp2.test_gloo_spawn_cpu_guard.pymatches neither glob and stays inrest. It is a guard, not a multi-rank suite.Not proven here
Runner timing is estimated by scaling: the catch-all is about 1258 s locally against roughly 2800 s projected on CI. That puts the new
restnear 1500 s andgloonear 1270 s, both under 2100 s. This PR's own run will show the real numbers.