Skip to content

[distributed] Reuse workers for DTensor API tests - #197649

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

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

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

Reuse workers across DTensor API cases and use the matching continuous LocalTensor harness for generated variants. Preserve four ranks for 2D mesh coverage, the existing LocalTensor skip, and all assertions.

Test plan: CUDA build and lint pass. All 20 cases pass with one existing skip: 62.112s before versus 10.946s after. Reverse-order run passes in 11.382s; one-visible-GPU CPU fallback passes in 6.894s. Post-build full-file run passes in 11.018s with the same skip.

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

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

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

  • Scope
    • Two hunks in test/distributed/tensor/test_api.py only; no product code, no workflow, and no public API touched
    • All 20 test_ bodies and their assertions are untouched, and the test_checkpoint_apis_check_partial_placement skip is preserved at test_api.py:445
  • Harness swap
    • DTensorContinuousTestBase and LocalDTensorContinuousTestBase both exist at common_dtensor.py:700 and :720, and create_local_tensor_test_class already takes base_class at :1246
    • Same conversion is in place in test_redistribute.py, test_tensor_ops.py, test_view_ops.py, and test_embedding_ops.py, which pair @with_comms with the continuous base
  • Rank preservation
    • Class attribute world_size = 4 replaces the old property and is read by _get_world_size at common_distributed.py:2051, which handles both forms
    • _get_device_type(4) at common_dtensor.py:635 still falls back to cpu under 4 devices, and _init_pg at :708 skips via TEST_SKIPS when ranks exceed the accelerator count
  • Testing
    • The diff is itself the test change, so coverage is the converted file; DTensorAPITest has no callers outside test_api.py:47 and :444

reason: clean
Reviewed commit: 082752d

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.

@pytorch-bot pytorch-bot Bot added ciflow/dtensor Run DTensor specific tests topic: not user facing topic category labels Sep 19, 2026
This was referenced Sep 19, 2026
@d4l3k
d4l3k marked this pull request as ready for review September 19, 2026 04:20
d4l3k added a commit that referenced this pull request Sep 19, 2026
Reuse workers across DTensor API cases and use the matching continuous LocalTensor harness for generated variants. Preserve four ranks for 2D mesh coverage, the existing LocalTensor skip, and all assertions.

Test plan: CUDA build and lint pass. All 20 cases pass with one existing skip: 62.112s before versus 10.946s after. Reverse-order run passes in 11.382s; one-visible-GPU CPU fallback passes in 6.894s. Post-build full-file run passes in 11.018s with the same skip.


ghstack-source-id: 3b6d7b5
Pull-Request: #197649
@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/144/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.

2 participants