-
Notifications
You must be signed in to change notification settings - Fork 5k
[DON'T MERGE] Run multi-rank CPU unit tests in CI via LOCAL_SIZE #8381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
delock
wants to merge
3
commits into
deepspeedai:master
Choose a base branch
from
delock:ci/cpu-multi-rank-local-size
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+19
−2
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,16 @@ jobs: | |
| runs-on: ubuntu-24.04 | ||
|
|
||
| env: | ||
| # The runner is single-socket, so CPU_Accelerator.device_count() reports 1 | ||
| # NUMA node and the per-device gate in tests/unit/common.py skips every | ||
| # multi-rank test. CPU ranks are plain processes over gloo, so advertise 4 | ||
| # local devices to let world_size<=4 tests run. The test harness re-sets | ||
| # LOCAL_SIZE per worker, so this value only affects the launch gate. | ||
| LOCAL_SIZE: '4' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is a non-merge commit, but its commit message has no AGENTS.md reference: AGENTS.md:L8-L8 Useful? React with 👍 / 👎. |
||
| # Multi-rank tests churn mp pools for hours; reused pools eventually hang in | ||
| # cleanup and stall workers until the 6h job limit. Fresh pools per test are | ||
| # slower but let the suite finish (knob documented in tests/unit/common.py). | ||
| DS_DISABLE_REUSE_DIST_ENV: '1' | ||
| DEFAULT_TORCH_PRESET: '2.10.0-cpu' | ||
| DEFAULT_TRANSFORMERS_SOURCE: 'git' | ||
| # Manual PyPI fallback only; scheduled and default manual runs use Git. | ||
|
|
@@ -274,5 +284,12 @@ jobs: | |
| run: | | ||
| unset TORCH_CUDA_ARCH_LIST # only jit compile for current arch | ||
| cd tests | ||
| HF_HOME=/tmp/hf_home/ pytest $PYTEST_OPTS --forked -n 4 unit/ --torch_ver="$TORCH_TEST_VERSION" | ||
| HF_HOME=/tmp/hf_home/ pytest $PYTEST_OPTS --forked -m 'sequential' unit/ --torch_ver="$TORCH_TEST_VERSION" | ||
| # The suite is split so each half gets fresh xdist workers: multi-rank pool | ||
| # teardown eventually wedges a worker, and one 3400-test process never | ||
| # reaches its summary inside the 6h job limit. maxfail is raised so every | ||
| # failure is listed, and timeout caps each half. | ||
| overall=0 | ||
| timeout 150m pytest $PYTEST_OPTS --maxfail=100000 --forked -n 4 unit/ --ignore=unit/v1 --torch_ver="$TORCH_TEST_VERSION" || overall=$? | ||
| timeout 150m pytest $PYTEST_OPTS --maxfail=100000 --forked -n 4 unit/v1 --torch_ver="$TORCH_TEST_VERSION" || overall=$? | ||
| HF_HOME=/tmp/hf_home/ pytest $PYTEST_OPTS --forked -m 'sequential' unit/ --torch_ver="$TORCH_TEST_VERSION" || overall=$? | ||
| exit $overall | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the
cpu-torch-latestjob, advertising four devices admits every distributed test withworld_size <= 4, not only CPU-safe tests. For example,tests/unit/ulysses_alst/test_ulysses_sp_hf.py:240-263defines an unguarded two-rank test that creates tensors oncuda:<rank>; becauseCPU_Accelerator.is_available()returns true, the harness does not skip it, and the all-unit pytest invocation at workflow line 283 will fail on the CPU-only PyTorch installation. Scope this override to an explicitly CPU-compatible subset or add CPU capability checks before enabling the previously skipped tests.Useful? React with 👍 / 👎.