Skip to content

[distributed] Reuse workers for DTensor strategy registration tests - #197661

Closed
d4l3k wants to merge 4 commits into
gh/d4l3k/155/basefrom
gh/d4l3k/155/head
Closed

d4l3k wants to merge 4 commits into
gh/d4l3k/155/basefrom
gh/d4l3k/155/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 strategy registration cases while preserving rank counts and LocalTensor coverage. Strategy contexts already restore registrations and clear propagation caches.

Test plan: CUDA build and lint; four registration tests in normal and reverse order and CPU fallback, plus the full file after rebuilding. Targeted runtime fell from 15.9s to 11.1s.

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (2 Unrelated Failures)

As of commit 7858973 with merge base 9b6e452 (image):

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

  • Harness switch is consistent
    • with_comms passes through on DTensorContinuousTestBase, which defines no init_pg, so the worker-loop PG is used (common_dtensor.py:894)
    • Retaining @with_comms on a continuous base matches already-migrated files such as test_convolution_ops.py
  • Rank count preserved
    • world_size = NUM_DEVICES is needed because DTensorTestMixin defines no world_size and MultiProcContinuousTest._get_world_size would fall back from -2 to device count
    • This reproduces the old DTensorTestBase.world_size property, which also returned NUM_DEVICES (common_dtensor.py:790-792)
  • LocalTensor coverage retained
    • base_class=LocalDTensorContinuousTestBase is required for a valid MRO, since create_local_tensor_test_class builds (base_class,) + orig_cls.__bases__ (common_dtensor.py:1266)
    • world_size survives into the generated class via the orig_cls.__dict__.copy() at common_dtensor.py:1251
  • Scope
    • Diff touches only test/distributed/tensor/test_op_strategy.py; no library, workflow, or public API change
    • Per-test registration cleanup is unchanged, since op_strategy_context restores strategies and clears caches in its finally (common_dtensor.py:1602-1614)

reason: clean
Reviewed commit: 7858973

Inference job

🐛 Report a wrong verdict

NEW FAILURES SUPPRESSED BY AI (non-blocking) - The following job failed, but the AI CI Advisor judged the failure not to be evidence against this change:

  • BC Lint / bc_linter (gh)

    AI verdict: AI verdict: infra issue

    The BC Lint job failed because GitHub's API rate limit was exceeded during the checkout step, preventing the job from even running the linter. The actual BC lint logic never executed.

    Full reasoning on HUD →

CRCR (non-blocking) - The following CRCR downstream CI job failed but is non-blocking:

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

d4l3k added a commit that referenced this pull request Sep 19, 2026
Amortize process-group startup across strategy registration cases while preserving rank counts and LocalTensor coverage. Strategy contexts already restore registrations and clear propagation caches.

Test plan: CUDA build and lint; four registration tests in normal and reverse order and CPU fallback, plus the full file after rebuilding. Targeted runtime fell from 15.9s to 11.1s.


ghstack-source-id: e51a621
Pull-Request: #197661
d4l3k added a commit that referenced this pull request Sep 19, 2026
Amortize process-group startup across strategy registration cases while preserving rank counts and LocalTensor coverage. Strategy contexts already restore registrations and clear propagation caches.

Test plan: CUDA build and lint; four registration tests in normal and reverse order and CPU fallback, plus the full file after rebuilding. Targeted runtime fell from 15.9s to 11.1s.


ghstack-source-id: e51a621
Pull-Request: #197661
@d4l3k

d4l3k commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

@pytorchbot merge

@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

Merge failed

Reason: 1 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

[ghstack-poisoned]
d4l3k added a commit that referenced this pull request Sep 21, 2026
Amortize process-group startup across strategy registration cases while preserving rank counts and LocalTensor coverage. Strategy contexts already restore registrations and clear propagation caches.

Test plan: CUDA build and lint; four registration tests in normal and reverse order and CPU fallback, plus the full file after rebuilding. Targeted runtime fell from 15.9s to 11.1s.

ghstack-source-id: 217221d
Pull-Request: #197661
@d4l3k

d4l3k commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

@pytorchbot merge

@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

Merge failed

Reason: 1 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@d4l3k

d4l3k commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

@pytorchbot merge -i

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged while ignoring the following 1 checks: BC Lint / bc_linter

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

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-cuda13.2-py3.12-gcc11-sm100 / test (smoke_b200, 1, 1, linux.dgx.b200)

Details for Dev Infra team Raised by workflow job

@d4l3k

d4l3k commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

@pytorchbot merge -i

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged while ignoring the following 2 checks: BC Lint / bc_linter, .github/workflows/trunk.yml / linux-jammy-cuda13.2-py3.12-gcc11-sm100 / test (smoke_b200, 1, 1, linux.dgx.b200)

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

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-cuda13.2-py3.12-gcc11-sm100 / test (smoke_b200, 1, 1, linux.dgx.b200)

Details for Dev Infra team Raised by workflow job

@Skylion007

Copy link
Copy Markdown
Collaborator

@pytorchbot merge -i

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your change will be merged while ignoring the following 1 checks: BC Lint / bc_linter

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/155/head branch November 27, 2026 01:51
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