Skip to content

[distributed] Reuse tensor parallel transformation workers - #197703

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

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

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

Reuse test workers across strict-export tensor-parallel transformations. Preserve the original rank cap and all numerical and graph-operation assertions; remove redundant parent setup.

Test plan: CUDA build and lint; all three tests in normal and reverse order, CPU-only and two-GPU runs. Four-GPU runtime drops from 21.251s to 7.820s (reverse 7.612s).

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

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

✅ No Failures

As of commit d1d2c33 with merge base b7954b2 (image):
💚 Looks good so far! There are no failures yet. 💚

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

  • Scope
    • Test-only: the diff touches just test/distributed/tensor/experimental/test_tp_transform.py, swapping DTensorTestBase for DTensorContinuousTestBase
    • The same migration already exists in sibling files (test_common_rules.py:18, test_embedding_ops.py:35, test_view_ops.py:45), so the pattern is established
  • Preservation
    • world_size = NUM_DEVICES reproduces the removed DTensorTestBase.world_size property at common_dtensor.py:791, keeping the rank cap identical
    • The deleted setUp only called super().setUp(), so removing it changes nothing beyond inheriting MultiProcContinuousTest.setUp
    • Multi-device skip survives via DTensorContinuousTestBase._init_pg at common_dtensor.py:710 and the SystemExit handler in _worker_loop at common_distributed.py:1943
  • Correctness
    • world_size is set as a plain class attribute, which the device_type property path in _ensure_processes_spawned at common_distributed.py:2096 requires
    • with_comms becomes a passthrough since neither DTensorTestMixin nor MultiProcContinuousTest defines init_pg, per the guard at common_dtensor.py:894
    • All three tests keep their assertEqual numerical checks and assert_has_c10d_ops graph assertions unchanged
  • Risk surface
    • No production code, public API, CI workflow, or policy documentation is touched, and no job is added to pull.yml or trunk.yml

reason: clean
Reviewed commit: d1d2c33

Inference job

🐛 Report a wrong verdict

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

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #197705

pytorchmergebot pushed a commit that referenced this pull request Sep 19, 2026
Move ordering and overwrite checks unchanged into a continuous-worker class. Keep compiler, asynchronous checkpoint and uninitialized-distributed tests on the existing harness. Preserve rank limits and the combined CPU/accelerator backend.

Test plan: CUDA build and lint; ordering/overwrite tests in normal and reverse order, expected CPU/two-GPU skips, plus original no-distributed, stateful loading, backend rejection and initialization regressions. Two-test runtime drops from 11.433s to 5.631s.
Pull Request resolved: #197704
Approved by: https://github.com/pytorchgreenlight
ghstack dependencies: #197647, #197648, #197703
pytorchmergebot pushed a commit that referenced this pull request Sep 19, 2026
Reuse workers for FLEX and SDPA input-argument tests, preserving two ranks and all mock, layout, and value assertions. Keep attention execution and sharding-registration tests on their existing fixtures.

Test plan: CUDA build and lint; eight tests in normal/reverse order and CPU/single-visible-GPU fallback. Runtime drops from 38.086s to 9.019s; reverse 8.716s.
Pull Request resolved: #197705
Approved by: https://github.com/pytorchgreenlight
ghstack dependencies: #197647, #197648, #197703, #197704
@github-actions
github-actions Bot deleted the gh/d4l3k/189/head branch November 24, 2026 01:45
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