Repository navigation
Pipeline parallel: agree on overflow once when explicitly unscaling - #16417
Conversation
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. 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". |
|
Codex Review: Didn't find any major issues. Nice work! 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: Didn't find any major issues. Another round soon, please! 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.
Explicit
PipelineParallel.unscale_performs stage overflow agreement twice when the scaler is already bound. Bind it before unscaling and let the existing wrapper perform the single agreement, preserving main's fused Adam/AdamW support.The regression test covers 64 configurations across Adam/AdamW, fused and non-fused optimizers, implicit and explicit unscaling, finite steps and overflow on either or both ranks. It checks updates against an independent optimizer, scale growth/backoff, collective counts, pickling and hook cleanup. Base performs
[2, 2, 2]reductions; head performs[1, 1, 1], with numerical and cleanup checks passing on both arms. The composed PP/FSDP2 fixture injects overflow before agreement and retains its original global-skip assertions.Validation on
e63094e40against merge baseff3f063a3:Focused performance on an exclusive Kaggle T4x2 kernel, torch 2.11.0, ABBA x3 in fresh processes, disjoint rank CPUs, 200 warmup and 1000 measured calls/process:
The 236.0 us improvement exceeds the 44.6 us maximum arm spread. The paired bootstrap interval is 33.2%-36.5% lower helper latency; memory readings are unchanged. This measures the helper rather than total training throughput. The focused reproduction needs no model weights.