Skip to content

Backend CI: run the context parallel compose gloo suite in its own shard - #16447

Merged
danielhanchen merged 4 commits into
mainfrom
dh/gloo-cp-shard
Nov 2, 2026
Merged

danielhanchen merged 4 commits into
mainfrom
dh/gloo-cp-shard

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Since #16407, Repo tests (CPU, gloo) sits right at its step cap. On main (9341351954) it ran 1922 s of the 2100 s cap. On #16444, against the same base, it hit the cap and was killed (exit code 124) after 145 of its 153 tests had passed.

#16407 grew tests/test_parallel_cp_compose_gloo.py to 27 tests. I timed the shard per file locally (-n 4 --dist loadgroup --durations=0, the CI selection). That one file takes 1143 of the shard's 3605 test-seconds, about a third:

File test-seconds share
test_parallel_cp_compose_gloo.py 1143 31.7%
test_tp_env_gloo.py 796 22.1%
test_tp_replica_gloo.py 533 14.8%
test_tp_full_finetune_gloo.py 429 11.9%
the other 12 files 704 19.5%

gloo-tp-pp cannot absorb it, because it already runs 1397 s on main.

The file also cannot run four tests at a time on its own. Each test spawns 2 to 8 gloo ranks. In this PR's first two runs of a dedicated shard at -n 4, the runner was shut down mid-run both times (The runner has received a shutdown signal, exit 143). Measured locally as summed PSS over the pytest process tree, the peak is:

workers peak memory local wall time
4 about 20 GB 291 s
2 about 12 GB 440 s

A hosted runner has 16 GB. In the mixed gloo shard, the file's tests were interleaved with lighter ones, so they rarely overlapped four at a time.

Change

.github/workflows/studio-backend-ci.yml:

  • New gloo-cp shard: tests/test_parallel_c*gloo*.py, with workers: 2.
  • The repo-cpu pytest command reads -n ${{ matrix.workers || 4 }}, so every other shard keeps -n 4.
  • The gloo shard's tests/test_p[!p]*gloo*.py becomes tests/test_parallel_[!c]*gloo*.py. Its other globs are unchanged.
  • Comments record why the split and the worker count exist. They also note that a future *gloo* file named test_p[!ap]* would match no shard; tests/test_ci_repo_cpu_shards.py reports that as a dropped file.

tests/studio/test_backend_ci_parallel_isolation.py:

  • Its command scan substitutes each shard's workers (or the expression's default), the way it already substitutes selection. Before that, its existing "no unexpanded ${{" assertion caught the new expression.
  • The pinned counts move from 11 to 12 parallel runs, and from 8 to 9 repo-root shards.

Testing

  • With main (now including Repair the three CI checks #16407 left red on main #16446) merged in, these pass (176 passed):
    • tests/test_ci_repo_cpu_shards.py
    • tests/test_ci_backend_pytest_shards.py
    • tests/studio/test_backend_ci_parallel_isolation.py
    • tests/test_rendezvous_port_everywhere.py
    • tests/studio/test_cache_budget_discipline.py
  • tests/test_parallel_cp_compose_gloo.py at -n 2: 23 passed, 3 skipped.
  • A first attempt, test_p[!ap]*gloo*.py, matched no file, and the guard's unexpanded-pattern check caught it. Hence the explicit test_parallel_ globs.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T05:27:04.234177Z 7bca4d4 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 4d345ae1a9

ℹ️ 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".

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 36a5a078cf

ℹ️ 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".

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 7bca4d44dc

ℹ️ 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".

@danielhanchen
danielhanchen merged commit a848037 into main Nov 2, 2026
@danielhanchen
danielhanchen deleted the dh/gloo-cp-shard branch November 2, 2026 06:23
danielhanchen added a commit that referenced this pull request Nov 4, 2026
…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.
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