Repository navigation
Treat an all-deselected selection as success in cpu-torch-latest-v1-multirank - #9032
Merged
delock merged 3 commits intoNov 8, 2026
Merged
Conversation
…ultirank The workflow guards an empty test selection (exit 0) but not a selection whose targets hold no multi-rank tests: DS_MULTIRANK_ONLY deselects every single-rank test, pytest then reports "no tests ran" and exits 5, and the job fails red. Any PR that only changes non-distributed tests under tests/unit/v1 (e.g. deepspeedai#8939) hits this. Treat pytest exit code 5 as a green skip, like the empty-selection case, and pass every other exit code through. Signed-off-by: Ma, Guokai <guokai.ma@intel.com>
Codex Review Summary: ✅ CompletedThis 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. |
Contributor
|
Exit 5 should be accepted in subset mode. In mode=all, an empty run can only mean the multi-rank selector broke. |
hwchen2017
approved these changes
Nov 7, 2026
…h-latest-v1-multirank mode=all selects the whole v1 scope, so an empty run there can only mean the selector or the multi-rank gate broke; keep that failure visible instead of masking it. Plumb the selection mode from collect-tests into the test step so the two cases can be told apart. Signed-off-by: Guokai Ma <guokai.ma@intel.com>
Collaborator
Author
@hwchen2017 thanks for pointing this out. The latest commit guard this change in subset mode only. Thanks! |
delock
enabled auto-merge
November 8, 2026 02:37
banxingmjj
pushed a commit
to openanolis/DeepSpeed
that referenced
this pull request
Nov 11, 2026
…pspeedai#9053) The modal-torch-latest GPU controller (ci/torch_latest.py) runs pytest remotely in a Modal sandbox / AWS instance and treats any nonzero pytest exit as a candidate failure. A diff-selected (subset) run whose only targets skip on the runner collects nothing, so pytest exits 5 ("no tests collected") and the job fails red even though the run is a legitimate green no-op. Observed on run 42921207259 (merge_group for deepspeedai#8867): the selector picked only tests/unit/v1/accelerator/test_klxpu_accelerator.py, which is module-level skipped on NVIDIA runners, so pytest reported "4 workers [0 items]" / "1 skipped" and the controller raised RemoteCommandError: run pytest failed with exit code 5. This mirrors the merged sibling fix for cpu-torch-latest-v1-multirank (deepspeedai#9032), which maps pytest exit 5 to a green skip for subset selections. That fix only touched the CPU workflow's shell step; the GPU controller delegates all run/classify logic to ci/torch_latest.py, so the equivalent guard belongs there and must cover both the Modal and AWS backends. - Add EXIT_NO_TESTS = 5 and a shared EMPTY_SELECTION_MESSAGE. - run_controller (Modal): a "run pytest" failure with code 5 in subset mode returns 0 with the message instead of raising. - run_aws_controller (AWS): same guard on test_code. - Gate on selection_mode == "subset"; mode=all runs the whole tests/unit/v1 scope, where an empty collection means the selector or a collection guard broke and must still fail. Other exit codes (1, 124) are unchanged. - Add controller/AWS tests for the subset no-op and the mode=all guard. AI assistance was used to analyze the failing run and draft this patch. Signed-off-by: guhangsong <guhangsong@outlook.com> Co-authored-by: Ma, Guokai <guokai.ma@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cpu-torch-latest-v1-multirankfails red on any PR whose diff-selectedtests/unit/v1targets contain no multi-rank tests.DS_MULTIRANK_ONLY=1deselects every single-rank test (see thepytest_collection_modifyitemshook intests/conftest.py), pytest then reportsno tests ranand exits with code 5, and the job fails — even though the run is a legitimate green no-op.The workflow already guards the empty-selection case (
No v1 tests selected; nothing to run.→exit 0) but not the all-deselected case. This PR treats pytest exit code 5 the same way: a green skip with a clear message. Every other exit code is passed through unchanged, so real test failures (1), usage errors (4), and internal errors (3) still fail the job.Root cause
Observed on #8939 (run 42374006158): the diff-based selector (
ci/tests_fetcher.py) correctly selected exactly one target,tests/unit/v1/test_hybrid_engine_rollout_v1.py, but all of its tests are plain single-process tests, notDistributedTestsubclasses. The multirank filter deselected all of them:Per pytest's documented exit-code convention, 5 means "no tests were collected" — a neutral "nothing to run" signal, not a failure. Any PR touching only non-distributed tests under
tests/unit/v1hits this.Implementation
set +e/set -escoped to that one command).No multi-rank tests in the selection; nothing to run.when it is 5, mirroring the existing empty-selection guard one branch above.exit "$pytest_exit"for everything else.The nightly
cpu-torch-multi-latestalso setsDS_MULTIRANK_ONLY=1but runs the wholeunit/tree (excludingv1/), which always contains multi-rank tests, so it cannot hit this edge and is not changed.Validation
bash -non the extractedUnit testsscript: pass.pre-commit run --files .github/workflows/cpu-torch-latest-v1-multirank.yml: all hooks pass.Duplicate-work check
Searched open PRs and issues for
multirank,no tests ran, andexit code 5; nothing addresses this.AI assistance
This change was prepared with AI assistance (analysis of the failing CI run and drafting of the patch); every line was reviewed, and all listed validation was run, by the human submitter.