Skip to content

[distributed] Reuse workers for tensor-parallel API tests - #197658

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

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

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

Reuse distributed workers across tensor-parallel API cases instead of spawning and initializing a process group per test. Preserve the rank-count rule and LocalTensor coverage.

Test plan: CUDA build and lint; all 32 tests in normal and reverse order and CPU fallback, with the same existing LocalTensor skip. Normal runtime fell from 96.2s to 10.4s.

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

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

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

  • Scope
    • Only test/distributed/tensor/parallel/test_parallelize_api.py changes: base class swap plus base_class= arg; no production or CI code touched
    • Mirrors the already-landed pattern in test/distributed/tensor/test_embedding_ops.py and test_redistribute.py, which pass base_class=LocalDTensorContinuousTestBase
  • Correctness
    • world_size had to become a class attribute: MultiProcContinuousTest._ensure_processes_spawned calls device_type_attr.fget(cls), and DTensorTestMixin.device_type reads self.world_size, which a property would not resolve on the class
    • The rank rule is preserved verbatim — _gpu_num % 2 == 0 and _gpu_num > 4 yields the same 4/6/8 values, and 0 on CPU-only builds still falls to 4
    • create_local_tensor_test_class builds bases (LocalDTensorContinuousTestBase, DTensorContinuousTestBase), a valid MRO since the former subclasses the latter (common_dtensor.py:720)
  • Preservation
    • No assertions, skips, or branches removed; the test_parallelize_module_src_data_rank LocalTensor skip is kept, and @with_comms still passthroughs since the continuous base exposes _init_pg, not init_pg

reason: clean
Reviewed commit: 1582ca1

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 #197661

@d4l3k

d4l3k commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 21, 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

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #197661

@github-actions
github-actions Bot deleted the gh/d4l3k/153/head branch November 23, 2026 01:47
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.

2 participants