Skip to content

Add a nightly multi-rank CPU suite - #8806

Merged
delock merged 7 commits into
deepspeedai:masterfrom
delock:pr-r-cpu-multi-nightly
Oct 16, 2026
Merged

delock merged 7 commits into
deepspeedai:masterfrom
delock:pr-r-cpu-multi-nightly

Conversation

@delock

@delock delock commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

What

Adds the world_size axis to CI, which the current suite does not cover:

File Purpose
.github/workflows/cpu-torch-multi-latest.yml Nightly + manual dispatch: runs the multi-rank CPU tests on a 4-vCPU runner
.github/workflows/cpu-multi-triage.yml Routes its outcome through the existing ci/nightly_classify.sh / ci/nightly_report.sh protocol
tests/conftest.py The DS_MULTIRANK_ONLY collection hook the workflow selects with (required)
.github/workflows/TEST_SELECTION.md Registration of the new nightly

Why

cpu-torch-latest advertises a single device, so the per-device gate in
tests/unit/common.py skips every world_size > 1 test on that runner. The
multi-rank path is therefore only exercised on GPU machines, and issues that show up
there only in a multi-rank configuration go unnoticed.

A recent example: PR #8638 changed the overflow semantics so that non-finite
group norms force an optimizer step to be skipped, bypassing
bf16.check_grad_overflow: False. TestZeROBFloat16::test_ignore_grad_overflow is
world_size = 2, so it is collected and skipped by the CPU CI and by any run with
one device; it fails as soon as two ranks execute. Reported as issue #8805.

Why a nightly rather than a pre-merge check

The selection is cheap to state and expensive to run (measured in #8381, 4-vCPU
runner):

Run Wall time
This suite: non-v1 multi-rank half 68-89 min
This suite: sequential-marked phase 13-16 min
Longest current pre-merge job (cpu-torch-latest) 39-43 min
Longest merge-queue job (modal-torch-latest) 64-71 min

Putting it in the pre-merge path would roughly triple the critical path of every PR,
and a single wedged rank would block the merge queue (the suite's known hang — the
shm op segfaulting on hosts without AVX512 — is fixed by #8701, but the suite is the
most expensive one to re-run).

What it runs

  • LOCAL_SIZE=4 so the gate admits world_size <= 4; DS_MULTIRANK_ONLY=1 deselects
    the single-rank tests that cpu-torch-latest already guards.
  • Non-v1 half, timeout 120m, plus a sequential-marked phase, timeout 25m (the
    parallel phase deselects those by default, so they would otherwise never run here).
  • Same preset/install/HF-predownload steps as cpu-torch-latest, so both runs agree on
    the environment.
  • On failure the last step prints DS_CI_FAILURE_CLASS=timeout|test for triage; a run
    that dies before that step is reported as unclassified rather than guessed.

Triage is a separate workflow with its own issue titles and its own
nightly-cpu-multi-last-green tag, so nightly-last-green keeps meaning "the last
revision the full GPU suite verified" and the modal issue dedupe is untouched.

Validation

  • Workflow YAML parses; pre-commit clean.
  • Timings above come from the real runs of this configuration in [DON'T MERGE] Run multi-rank CPU unit tests in CI via LOCAL_SIZE #8381.
  • Not yet run as cpu-torch-multi-latest: GitHub only exposes workflow_dispatch for
    workflows present on the default branch, so the first manual dispatch has to happen
    after this merges. Happy to run it then and follow up with the numbers.

cpu-torch-latest advertises a single device, so the per-device gate in
tests/unit/common.py skips every world_size > 1 test there. This adds a
nightly run that sets LOCAL_SIZE and selects only the multi-rank tests
(DS_MULTIRANK_ONLY), which is how the bf16 overflow semantics change from
deepspeedai#8638 was found (issue deepspeedai#8805).

It is a nightly rather than a pull-request check: the multi-rank half
needs ~70-90 minutes on a 4-vCPU runner (measured in deepspeedai#8381), against 39
minutes for the longest current pre-merge job, and a wedged rank would
hold up the merge queue.

The companion triage workflow reuses ci/nightly_classify.sh and
ci/nightly_report.sh with its own issue titles and its own last-green
tag, so the modal full-suite tag and its issue dedupe are untouched.

Signed-off-by: Guokai Ma <guokai.ma@intel.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 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-10-12T01:11:11.556032Z 95c20f9 PR opened
ℹ️ 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.

@delock

delock commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator Author

Note #8805 needs to be fixed for this nightly to pass.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95c20f96b1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/cpu-torch-multi-latest.yml Outdated
Comment thread .github/workflows/cpu-multi-triage.yml Outdated
Comment thread .github/workflows/cpu-torch-multi-latest.yml
Comment thread tests/conftest.py
Comment thread .github/workflows/cpu-torch-multi-latest.yml Outdated
Comment thread .github/workflows/cpu-torch-multi-latest.yml Outdated
Signed-off-by: Ma, Guokai <guokai.ma@intel.com>
GitHub Actions echoes a run: script into the job log before executing it,
so the inline sentinel literals were matched by nightly_classify.sh's
head -1 ahead of any runtime line, routing every failure as a timeout.
Print the sentinel from ci/classify_multirank_exit.py instead, mirroring
the modal nightly's controller, and pin the contract with tests.

Signed-off-by: Ma, Guokai <guokai.ma@intel.com>
Inside a POSIX bracket expression \t is backslash-and-t, not a tab, so
the class excluded the letter t and matched no test_*.py path at all;
the report job then aborted before nightly_report.sh could run. Use the
[[:space:]] class, and turn the FAILED prefix into the tests/ prefix
instead of prepending to it.

Signed-off-by: Ma, Guokai <guokai.ma@intel.com>
The selector in tests/conftest.py runs only in the nightly multi-rank
workflow, so CI never exercised it. Drive the real conftest in a sandbox
and pin the observable contract: the gate is a no-op when disabled, only
world_size>1 dist tests survive when enabled, and a method mark
overrides the class world_size in both directions.

Signed-off-by: Ma, Guokai <guokai.ma@intel.com>
Both runs on master resolved the concurrency group to the same value, so
a debug dispatch with cancel-in-progress killed the scheduled nightly
mid-run and triage reported the cancellation as a failure. Include the
event name in the group, as modal-torch-latest already does.

Signed-off-by: Ma, Guokai <guokai.ma@intel.com>
The second phase's exit code overwrote the first's, so the same pair of
failures classified differently depending on phase order and a timeout
could be silently downgraded to a test failure. Keep both exit codes and
classify 124 first: a timeout means the budget ran out and more failures
may remain undiscovered.

Signed-off-by: Ma, Guokai <guokai.ma@intel.com>

@tohtana tohtana left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @delock,
This looks good to me, and I agree with the overall direction of the test refactoring plan!

@tohtana
tohtana added this pull request to the merge queue Oct 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 13, 2026
@delock
delock added this pull request to the merge queue Oct 15, 2026
Merged via the queue into deepspeedai:master with commit 3bd1b67 Oct 16, 2026
15 checks passed
@delock
delock deleted the pr-r-cpu-multi-nightly branch October 16, 2026 00:12
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.

2 participants