Skip to content

Use the accelerator device in TestZero3SynchronizedEarlyStop - #9058

Merged
delock merged 2 commits into
deepspeedai:masterfrom
dundysm:fix-9033-rollout-early-stop-device
Nov 12, 2026
Merged

delock merged 2 commits into
deepspeedai:masterfrom
dundysm:fix-9033-rollout-early-stop-device

Conversation

@dundysm

@dundysm dundysm commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

what

TestZero3SynchronizedEarlyStop (added in #8390) builds its tensors on torch.device(f"cuda:{rank}"). on the cpu multi-rank nightly (cpu-torch-multi-latest, LOCAL_SIZE=4) the test is admitted by the world-size gate, and the first torch.tensor(..., device=device) raises AssertionError: Torch not compiled with CUDA enabled. that is the 2026-11-11 recurrence in #9033 (run 42957495892).

this takes the device from get_accelerator().current_device_name(), which is cpu on the cpu accelerator and cuda:<local rank> on cuda, so the gpu path is unchanged.

why this is not a duplicate

no open pr touches this test; #9009 and #9037 edit the same file but not this class.

tests

on cpu (8 vcpu x86_64, torch 2.15.0+cpu, python 3.12), with LOCAL_SIZE=4:

  • before: pytest unit/runtime/rollout/test_hybrid_engine_rollout.py::TestZero3SynchronizedEarlyStop fails with Torch not compiled with CUDA enabled, same traceback as the nightly
  • after: 1 passed
  • pytest unit/runtime/rollout/: 94 passed, 2 skipped; TestZero3SubgroupGeneration failed locally only because accelerate is not installed in my env
  • flake8 and yapf clean on the changed file

not run on gpu; the cuda device string is the same as before apart from using the local rank instead of the global rank.

fixes #9033 (the hybrid engine rollout part; the earlier test_tp_compile.py failure looked flaky per the thread)

The test hardcoded torch.device(f"cuda:{rank}"), so the cpu multi-rank
nightly fails with "Torch not compiled with CUDA enabled" as soon as the
prompt tensors are built. Take the device from get_accelerator() like the
rest of the suite.

Signed-off-by: Dundy Pasupuleti <dundysm@gmail.com>
@dundysm

dundysm commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@delock this should clear the hybrid engine rollout failure in the cpu multi-rank nightly from #9033; it is a one line device fix in the test from #8390. could you take a look when you have a moment?

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T18:36:40.507149Z 7f21102 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 Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Hi @dundysm thanks for catching this!

@delock
delock enabled auto-merge November 12, 2026 07:56
@delock
delock added this pull request to the merge queue Nov 12, 2026
Merged via the queue into deepspeedai:master with commit dfa7d34 Nov 12, 2026
18 checks passed
@gpu-test-labeler gpu-test-labeler Bot added the skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. label Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nightly regression: cpu-torch-multi-latest multi-rank suite failed

2 participants