Skip to content

Reuse workers for tensor parallel style tests - #197691

Closed
d4l3k wants to merge 1 commit into
gh/d4l3k/181/basefrom
gh/d4l3k/181/head
Closed

d4l3k wants to merge 1 commit into
gh/d4l3k/181/basefrom
gh/d4l3k/181/head

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

Reuse workers for model-local parallel style tests. Keep sequence-parallel RNG initialization in a fresh-process class, including its LocalTensor variant, to preserve isolation.

Test plan: CUDA build and lint; all 22 cases normally and in reverse order, CPU fallback, two GPUs, and after build. Four-GPU runtime falls from 66.42s to 14.97s before rebuild.

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

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

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

  • Scope
    • Test-only change confined to test/distributed/tensor/parallel/test_tp_style.py; no torch/ source or workflow files touched
    • Splits TensorParallelStyleTest onto DTensorContinuousTestBase and moves test_sequence_parallel_style into a new SequenceParallelStyleTest on DTensorTestBase
  • Correctness
    • world_size = NUM_DEVICES as a class attribute is what MultiProcContinuousTest requires (common_distributed.py:1848), matching existing usage at test_redistribute.py:73
    • with_comms passes through when init_pg is absent (common_dtensor.py:894), and init_pg is defined only on DTensorTestBase (common_dtensor.py:799), so reused-worker PG setup is correct
    • MRO holds for both generated classes: create_local_tensor_test_class builds (base_class,) + orig_cls.__bases__ (common_dtensor.py:1264) and each base_class subclasses the original base
  • Preservation
    • All 22 test bodies are carried over unchanged; test_sequence_parallel_style keeps its early RNG-tracker init at test_tp_style.py:378 in the fresh-process class
    • Its LocalTensor variant SequenceParallelStyleTestWithLocalTensor uses the default base_class=LocalDTensorTestBase, preserving per-test isolation
  • Established pattern
    • DTensorContinuousTestBase/LocalDTensorContinuousTestBase are already used this way across test_redistribute.py, test_tensor_ops.py, test_view_ops.py, and test_embedding_ops.py
    • Grep for TensorParallelStyleTest and test_sequence_parallel_style shows no external references outside this file, so the class split breaks no caller or skip list

reason: clean
Reviewed commit: 517c07a

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.

@d4l3k

d4l3k commented Sep 19, 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 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

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