Skip to content

Reuse workers for sharded embedding tests - #197697

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

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

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

Reuse four workers across rowwise and columnwise embedding tests that already disable RPC. Preserve the complete sharding, padding and renormalization matrix.

Test plan: CUDA build and lint; both tests normally, in reverse order and after build; two expected skips on two GPUs and CPU. Baseline 13.28s; reused workers 6.91s before rebuild.

@pytorch-bot pytorch-bot Bot added the topic: not user facing topic category label 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/197697

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

✅ You can merge normally! (3 Unrelated Failures)

As of commit a7ce005 with merge base b7954b2 (image):

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

  • Scope
    • Test-only change confined to test/distributed/_shard/sharded_tensor/ops/test_embedding.py; no product code, CI config, or public API touched
    • _run_sharded_embedding and all 17 sharding/padding/max_norm call sites are untouched, so the coverage matrix is preserved
  • Harness migration
    • TestShardedEmbedding moves from ShardedTensorTestBase to DTensorContinuousTestBase with world_size = TEST_GPU_NUM, mirroring TestShardedOptimizer at test/distributed/_shard/sharded_optim/test_sharded_optim.py:89
    • Bare @with_comms is a passthrough here: common_dtensor.with_comms returns early when self has no init_pg, and MultiProcContinuousTest only defines the classmethod _init_pg, so the PG comes from the worker loop
    • DTensorContinuousTestBase._init_pg binds torch.accelerator.set_device_index(rank) and backend_str() resolves the device default backend, matching the removed init_pg(backend=...) and init_rpc=False behavior
  • Skip paths
    • skip_if_lt_x_gpu(TEST_GPU_NUM) calls sys.exit in the worker, which _worker_loop maps to unittest.SkipTest via TEST_SKIPS at torch/testing/_internal/common_distributed.py:1978
    • requires_accelerator_dist_backend raises SkipTest, handled at common_distributed.py:1975, so the fewer-than-4-GPU and CPU cases still skip cleanly
  • Removals
    • The deleted module-level device_type/backend globals have no remaining references in the file; _test_ops_common supplies its own device_type for placements

reason: clean
Reviewed commit: a7ce005

Inference job

🐛 Report a wrong verdict

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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.

@Skylion007

Copy link
Copy Markdown
Collaborator

@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

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-cuda13.2-py3.10-gcc11 / test (default, 4, 14, mt-l-x86aavx2-29-113-l4)

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 1 checks: trunk / linux-jammy-cuda13.2-py3.10-gcc11 / test (default, 4, 14, mt-l-x86aavx2-29-113-l4) (#197697)

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/186/head branch November 24, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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