Skip to content

[distributed] Reuse workers for strided DTensor tests - #197674

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

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

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

Use continuous workers for strided sharding, local-shard offsets, optimizer updates, and replication tests. Preserve four ranks, the LocalTensor variants, and all assertions. The 21 cases took 112.8s across baseline runs and 50.4s in the combined continuous run.

Test plan: CUDA build and lint; all 21 cases in normal and reversed order, on CPU, and after rebuilding.

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

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

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

  • Scope
    • Test-only: the diff touches just test/distributed/tensor/test_utils.py, with no production, docs, or CI-workflow changes.
    • Follows the existing pattern in the same file, where UtilTest already uses DTensorContinuousTestBase with a world_size class attribute.
  • Base-class contract
    • The world_size property-to-class-attribute change is required: _ensure_processes_spawned evaluates the device_type property against cls before world_size is resolved.
    • _get_world_size in common_distributed.py reads cls.world_size for the non-property path, and all four converted classes keep world_size = 4.
  • LocalTensor variants
    • create_local_tensor_test_class builds bases as (base_class,) + orig_cls.__bases__, so passing LocalDTensorContinuousTestBase is needed to keep the MRO valid against the new parent.
    • Both TestStridedShardingWithLocalTensor and Test2DStridedLocalShardWithLocalTensor are preserved and get that base explicitly.
  • Preservation
    • with_comms is a passthrough when the class lacks init_pg, which DTensorContinuousTestBase does, so process-group setup moves to the worker loop without dropping any test body.
    • No assertions, test methods, or skip decorators are removed, and the now-unused DTensorTestBase import has no remaining reference in the file.

reason: clean
Reviewed commit: 5d45eb5

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
@d4l3k
d4l3k marked this pull request as ready for review September 19, 2026 04:37
d4l3k added a commit that referenced this pull request Sep 19, 2026
Use continuous workers for strided sharding, local-shard offsets, optimizer updates, and replication tests. Preserve four ranks, the LocalTensor variants, and all assertions. The 21 cases took 112.8s across baseline runs and 50.4s in the combined continuous run.

Test plan: CUDA build and lint; all 21 cases in normal and reversed order, on CPU, and after rebuilding.


ghstack-source-id: 591c590
Pull-Request: #197674
d4l3k added a commit that referenced this pull request Sep 19, 2026
Use continuous workers for strided sharding, local-shard offsets, optimizer updates, and replication tests. Preserve four ranks, the LocalTensor variants, and all assertions. The 21 cases took 112.8s across baseline runs and 50.4s in the combined continuous run.

Test plan: CUDA build and lint; all 21 cases in normal and reversed order, on CPU, and after rebuilding.


ghstack-source-id: ab65bc6
Pull-Request: #197674
@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

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