Skip to content

[distributed] Reuse workers for DTensor subclass tests - #197655

Closed
d4l3k wants to merge 2 commits into
gh/d4l3k/150/basefrom
gh/d4l3k/150/head
Closed

d4l3k wants to merge 2 commits into
gh/d4l3k/150/basefrom
gh/d4l3k/150/head

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

Use the continuous DTensor harness for the three subclass-dispatch tests, retaining the original device-count rank cap. Leave other DTensor classes unchanged.

Test plan: CUDA build and lint; all three cases in normal/reverse order and one-visible-GPU CPU fallback. Runtime falls from 16.3s to 5.2s.

@pytorch-bot pytorch-bot Bot added ciflow/dtensor Run DTensor specific tests topic: not user facing topic category labels Sep 19, 2026
@pytorch-bot

pytorch-bot Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/197655

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (2 Unrelated Failures)

As of commit 5b71594 with merge base b7954b2 (image):

🟢 GREEN LIGHT - PR approved to be merged without human review:

  • Scope
    • Test-only: reparents DTensorSubclassTest in test/distributed/tensor/test_dtensor.py:1012 and adds two imports; no product code touched
    • The three test bodies use only self.device_type, self.world_size and assertions, all still provided via DTensorTestMixin on the new base
  • Rank cap preserved
    • world_size = NUM_DEVICES matches the DTensorTestBase.world_size property it replaces (common_dtensor.py:791-792), so the device-count cap is unchanged
    • DTensorContinuousTestBase._init_pg (common_dtensor.py:708-717) still exits with the multi-device-N skip when world_size exceeds the accelerator count, and _get_device_type still falls back to CPU
  • Consistent with existing harness usage
    • TestEmbeddingOp (test_embedding_ops.py:35-36) uses the identical DTensorContinuousTestBase + world_size = NUM_DEVICES pairing
    • @with_comms becomes a passthrough here because no init_pg exists on this base (common_dtensor.py:894-896); test_tensor_ops.py:40-52 already relies on that same combination
  • Workflow surface
    • No .github/workflows file is touched, so no job is added to pull.yml/trunk.yml and no CI gate is altered

reason: clean
Reviewed commit: 5b71594

Inference job

🐛 Report a wrong verdict

CRCR (non-blocking) - The following CRCR downstream CI jobs failed but are non-blocking:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #197656

pytorchmergebot pushed a commit that referenced this pull request Sep 19, 2026
Amortize process-group startup across core DTensor cases using the continuous harness. Preserve the rank cap, LocalTensor variant and skips, assertions, and separate serialization-import subprocesses.

Test plan: CUDA build and lint; all 58 real/LocalTensor cases in normal and reverse order, one-visible-GPU CPU fallback, and postbuild. Three existing LocalTensor skips preserved. Runtime improves from 170.2s to 13.4s.
Pull Request resolved: #197656
Approved by: https://github.com/pytorchgreenlight
ghstack dependencies: #197647, #197648, #197655
pytorchmergebot pushed a commit that referenced this pull request Sep 22, 2026
…197657)

Share workers and the process group across the four initialization-info cases. Preserve the original rank cap and scoped environment patches; leave checkpoint process lifecycle tests unchanged.

Test plan: CUDA build and lint; four cases in normal/reverse order and one-visible-GPU CPU fallback; full six-test file postbuild. Four-case runtime improves from 22.2s to 5.7s.
Pull Request resolved: #197657
Approved by: https://github.com/pytorchgreenlight
ghstack dependencies: #197647, #197648, #197655, #197656
@github-actions
github-actions Bot deleted the gh/d4l3k/150/head branch November 23, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/dtensor Run DTensor specific tests Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants