Repository navigation
CI: split Repo tests (CPU, rest) and (CPU, gloo) before they reach their 2100 s cap - #15951
Conversation
|
@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. Already looking forward to the next diff. 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
… cannot shadow tests in later spawn children
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e41f945c7d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| # Non-vacuous: the run did change sys.path, which the restore below has to undo. | ||
| assert sys.path != before |
There was a problem hiding this comment.
Establish a clean path before asserting the export changes it
When this file is collected together with tests/test_studio_root_resilience.py, that module inserts studio/backend into sys.path at collection time. ensure_studio_backend_path() explicitly skips insertion when the path is already present, so this assertion fails even though the export succeeds and the restoration works correctly. This makes the new regression test fail in an unsharded suite or a combined run of those two files. Remove the backend path within the monkeypatch context before taking the comparison snapshot so the non-vacuity check does not depend on other collected modules.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Right, fixed in 9059efc (wrapped for the formatter in 280fd7e). When tests/test_studio_root_resilience.py is collected first it has already put studio/backend on sys.path, ensure_studio_backend_path() then skips the insert, and the non-vacuity assert failed with the restore working (reproduced: 1 failed, 17 passed for the two files together).
The guard now strips studio/backend in place from the copy _install_fake_studio_backend swaps in, so only that helper's restore can undo it, and asserts the run put it back on (backend_dir in sys.path and backend_dir not in clean). It is also first in the file, so the parametrized tests below cannot have leaked the path before it looks.
test_cli_export_unpacking.pyalone: 10 passed; withtest_studio_root_resilience.pycollected first: 18 passed.- With the helper's
sys.pathrestore removed, the guard fails in both runs.
…nd runs first in its file
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! 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". |
…shards (#16634) ## Summary `Repo tests (CPU, gloo-tp-pp)` is at its 2100 s cap. On #16618, which only touches the Studio MLX worker, it was interrupted with the suite almost done: ``` !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 174 passed, 7 skipped, 79 warnings, 320 subtests passed in 2088.59s (0:34:48) ##[error]Process completed with exit code 124. ``` The other recent runs of that job, across the last 20 PRs, took 30.5 to 36.2 minutes end to end, setup included, so a slightly slower runner is enough to tip it over. When this shard was created (#15951 split, #16447 comment) tensor plus pipeline parallel were about 1397 s. Pipeline parallel has grown a lot since then: every `torch.distributed.pipelining` schedule (#15655), per-stage sharded loading (#15656), no graph break on a non-last stage (#16167), and explicit-unscale overflow agreement (#16417). Nothing is wrong with those tests. The shard just outgrew its slot, the same way `gloo` did in #15951 and #16447. ## Change - `.github/workflows/studio-backend-ci.yml`: `gloo-tp-pp` becomes two shards with the same settings (`-n 4`, the 2100 s cap, the marker filter): - `gloo-tp`: `tests/test_tp_n*gloo*.py` (2 files); - `gloo-pp`: `tests/test_pp*gloo*.py` (8 files). - `tests/studio/test_backend_ci_parallel_isolation.py`: `test_the_command_scan_sees_the_parallel_run_and_the_serial_steps` pins the number of parallel pytest runs. It asks to be told when a shard is added, so its counts go from 12 to 13 parallel runs and from 9 to 10 repo-root shards. The selections are the old one split in two, so every file still runs exactly once. ## Testing - `tests/test_ci_repo_cpu_shards.py`: 15 passed. With `test_pp*gloo*` narrowed to `test_pp_[!n]*gloo*` as a sabotage, `test_no_file_is_dropped_or_run_twice` fails, so a dropped file is still caught. - `tests/studio/test_backend_ci_parallel_isolation.py`, `tests/test_ci_repo_cpu_shards.py` and the workflow and cache-budget guards under `tests/studio`: 164 passed. - The two new shards' run times on this PR's own CI are the real check. Both should finish well under the cap.
Summary
Repo tests (CPU, rest)is close enough to its 2100 s step cap that slow runners now hit it. On #15931 (staging) it finished15282 passed ... in 2092.47sand was then killed with exit 124, so the job went red after every test had passed. Across 16 staging runs on 2026-10-29 its pytest step took 1213 s to 2092 s; on the slower runners it sits at 1700 to 1820 s, 81 to 87% of the cap. This is the same thing #15851 did for the fsdp2 shard.What changed
restis split intorestand a newrest-2.rest-2takestests/diffusion,tests/kaggle,tests/securityand the top-leveltests/test_[dimsu]*.pyfiles, andrestignores the same paths.reststays the catch-all, so a new folder or file still lands there without a workflow edit.--durationsrun of the old shard (4 workers, 8 cores): those paths are about 1890 of its 3763 test-seconds, so each half carries about 50%.*gloo*ortest_fsdp2*file starts with d, i, m, s or u, so the glob root (which--ignorecannot filter) never names a file the gloo or fsdp2 shards also run.test_model_registry.pydeselects move with their file intorest-2.rest.gloois split the same way. It ran 1331 to 2058 s of the same 2100 s cap across 17 staging runs on 2026-10-29 (Studio diffusion: run both guidance branches per streamed block upload for Qwen-Image-Edit under a VRAM budget #15930's run took 1953 s), so it is next. Measured per file (4 workers, 8 cores; 4049 test-seconds), native tensor parallel plus pipeline parallel are about 51% and move to a newgloo-tp-ppshard (tests/test_tp_n*gloo*.py,tests/test_pp*gloo*.py);glookeeps everything else through four globs that exclude those two. A*gloo*file matching neither (a newtest_t[!p]*ortest_tp[!_]*name) is reported as dropped bytest_no_file_is_dropped_or_run_twice.tests/test_cli_export_unpacking.pyrestoressys.path. The first staging run of the split failed 7 tests and errored 4 in the newrest(test_tiled_mlp_ddp,test_reap_prune,test_gc_skip_auto_dist_cells), eachspawnchild dying withNo module named 'tests.<file>'. A per-testsys.pathwatcher over the full newrestshard named the cause: the CLI export run putsstudio/backendfirst onsys.path,studio/backend/testsis a package, and the test never took it back out, so every laterspawnchild in that xdist worker imported the wrongtests. It was order-dependent on main too; the new file distribution just put a spawn test after it on the same worker. A newtest_an_export_run_leaves_sys_path_as_it_found_itchecks the run does changesys.pathand that it is restored afterwards.tests/test_ci_repo_cpu_shards.py: the hub-test deselect check now asserts the deselect sits in the shard that actually collectstests/test_model_registry.py. Before, it only checked the text appeared anywhere in the matrix, which would still pass with the deselect left behind onrestafter the file moved.tests/studio/test_backend_ci_parallel_isolation.py: expects 11 parallel runs / 8 repo-root shards, and its path reader expands glob roots the way bash does (it previously treatedtests/test_fsdp2_*.py-style roots as literal paths, so no glob shard could ever be found collecting a file).Verification
pytest --collect-onlywith the oldrestselection: 18418 tests. With the newrestplusrest-2: 9711 + 8707 = 18418, no test in both, and the union is identical to the old set. The two deselected registry tests are not collected.gloo+gloo-tp-pp89 + 84, no overlap, identical set.tests/test_ci_repo_cpu_shards.py,tests/studio/test_backend_ci_parallel_isolation.py,tests/studio/test_cache_budget_discipline.py: all pass.tests/test_tz_probe_gloo.py(a name neither gloo shard globs) makestest_no_file_is_dropped_or_run_twicefail with that path.pytest tests/test_cli_export_unpacking.py tests/test_gc_skip_auto_dist_cells.pyin one process: 24 passed with the restore. Without it the new guard fails (1 failed, 9 passed).restmakestest_the_deselected_hub_tests_stay_deselectedfail.