Skip to content

Repair the three CI checks #16407 left red on main - #16446

Merged
danielhanchen merged 2 commits into
mainfrom
dh/fix-16407-ci
Nov 2, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
dh/fix-16407-ci

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

#16407 (9341351954) merged with three of its CI reds, so Backend CI and Core are now red on main and on every PR based on it. All three reproduce locally on current main (2f5ff226b8).

1. Repo tests (CPU, rest): a file in two shards

tests/test_ci_repo_cpu_shards.py::TestEveryTestFileLandsInExactlyOneShard::test_no_file_is_dropped_or_run_twice
AssertionError: these files are collected by more than one shard: [('tests/test_muon_dtensor_gloo.py', ['gloo', 'rest-2'])]

rest-2 takes tests/test_[dimsu]*.py, and the gloo shard takes tests/test_[!fpt]*gloo*.py. Their split relies on no *gloo* file starting with d, i, m, s or u, as the workflow comment says. The new test_muon_dtensor_gloo.py breaks that rule, so it ran twice.

An --ignore-glob on rest-2 does not help. The shell expands the glob into explicit file arguments, and pytest 9 collects explicit arguments even when they match --ignore-glob; I checked that locally. So the file is renamed to tests/test_optim_muon_dtensor_gloo.py, which only the gloo shard matches. The comment in test_parallel_env.py that names it follows the rename.

2. Repo tests (CPU, rest-2): an unencoded read

tests/test_source_read_encoding.py::test_checked_in_file_reads_name_an_encoding[1]
['tests/test_parallel_env.py:632: open()']

The new capability-registry test reads checked-in test files with the platform default encoding. It now passes encoding = "utf-8".

3. Core (all three combos): test_context_parallel_disables_eval_packing

tests/utils/test_packing.py:2185
    assert config.packing is False and config.eval_packing is False
E   assert (True is False)

This is the test being out of date, not the product. #16407 changed the default context_parallel_backend from "ring" to "auto". resolve_cp_backend resolves "auto" to Ulysses unless the heads cannot be split over cp, and Ulysses keeps packed rows apart. So the trainer now deliberately leaves packing on. The test sets no backend and still expected ring's behaviour.

The test now covers each backend:

  • ring: packing is turned off, as before;
  • ulysses, auto and unset: packing stays on.

Testing

Tests main this branch
tests/test_ci_repo_cpu_shards.py, tests/test_source_read_encoding.py, tests/utils/test_packing.py 3 failed, the three above pass
Those three plus tests/test_parallel_env.py 272 passed, 3 skipped
tests/test_optim_muon_dtensor_gloo.py 1 passed

@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-02T03:24:11.652678Z 72d83fe 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. Bravo.

Reviewed commit: 72d83fe7e2

ℹ️ 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 ee6640a into main Nov 2, 2026
@danielhanchen
danielhanchen deleted the dh/fix-16407-ci branch November 2, 2026 03:45
danielhanchen added a commit that referenced this pull request Nov 2, 2026
…ard (#16447)

## 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 #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.
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