Skip to content

[distributed] Reuse workers for core DTensor tests - #197656

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

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

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

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.

@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/197656

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 a6fee08 with merge base b7954b2 (image):

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

  • Scope
    • Test-only: three hunks in test/distributed/tensor/test_dtensor.py reparent DTensorTest and pass base_class to create_local_tensor_test_class; no library code changes
    • Both harness classes already exist at this commit (common_dtensor.py:700 and :720), so the diff adds no new infrastructure
  • Established pattern
    • test_redistribute.py:72, test_tensor_ops.py:40, test_view_ops.py:45 and test_embedding_ops.py:35 already subclass DTensorContinuousTestBase with the same base_class= wiring
    • DTensorSubclassTest at test_dtensor.py:1016 already uses DTensorContinuousTestBase with world_size = NUM_DEVICES, matching the new DTensorTest exactly
  • Preservation
    • world_size = NUM_DEVICES keeps the rank cap that DTensorTestBase.world_size supplied as a property at common_dtensor.py:791
    • DTensorContinuousTestBase._init_pg at common_dtensor.py:707 retains the device-count skip and CPU fallback that DTensorTestBase.init_pg:806 enforced
    • The three skipped_tests entries and every @with_comms decorator are untouched; with_comms passes through when init_pg is absent (common_dtensor.py:894)
  • Safety surface
    • No CI workflow, policy-doc, public API, or security-check edits; _attempt_load_from_subprocess stays reachable via TestCase (common_utils.py:5308) since MultiProcContinuousTest extends it

reason: clean
Reviewed commit: a6fee08

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.

@Skylion007

Copy link
Copy Markdown
Collaborator

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 19, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

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/151/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 ciflow/trunk Trigger trunk jobs on your pull request Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants