Skip to content

[distributed] Reuse workers for checkpoint initialization-info tests - #197657

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

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

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

Share workers and the process group across the four initialization-info cases. Preserve the original rank cap and scoped environment patches; leave checkpoint process lifecycle tests unchanged.

Test plan: CUDA build and lint; four cases in normal/reverse order and one-visible-GPU CPU fallback; full six-test file postbuild. Four-case runtime improves from 22.2s to 5.7s.

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

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:

❌ 1 New Failure, 3 Unrelated Failures

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

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

  • Scope
    • Test-only: TestProcessGroupInitInfo in test/distributed/checkpoint/test_async_process_executor.py switches base class; no production or CI file touched
    • TestAsyncProcessExecutor and TestAsyncProcessExecutorPrefixStore are left on their original bases, as the body claims
  • Harness correctness
    • DTensorContinuousTestBase (common_dtensor.py:700) defines no init_pg, so @with_comms takes its passthrough branch (common_dtensor.py:894) and the worker's _init_pg supplies the group
    • world_size = NUM_DEVICES reproduces the old DTensorTestBase.world_size property (common_dtensor.py:791) and must be a plain attr since _run_test_given_id assigns self.world_size (common_distributed.py:1913)
    • Same base plus @with_comms and a class-level world_size is already in use at test/distributed/checkpoint/test_state_dict_utils.py:32
  • Shared-state preservation
    • The assertRaises(CheckpointException) cases stay collective-safe: _DistWrapper.broadcast (utils.py:305) has rank 0 wrap and broadcast the error so every rank finishes the broadcast before raising
    • Every os.environ mutation stays inside a patch.dict context, including the pop("DCP_USE_PREFIX_STORE") under patch.dict(os.environ, {}, clear=False), so nothing leaks across the reused workers
    • No assertion reads pg_init_info.local_rank, the one field affected by _init_pg setting LOCAL_RANK (common_distributed.py:1893)

reason: clean
Reviewed commit: f67c919

Inference job

🐛 Report a wrong verdict

NEW FAILURE - The following job has failed:

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.

@d4l3k
d4l3k marked this pull request as ready for review September 19, 2026 04:19
d4l3k added a commit that referenced this pull request Sep 19, 2026
Share workers and the process group across the four initialization-info cases. Preserve the original rank cap and scoped environment patches; leave checkpoint process lifecycle tests unchanged.

Test plan: CUDA build and lint; four cases in normal/reverse order and one-visible-GPU CPU fallback; full six-test file postbuild. Four-case runtime improves from 22.2s to 5.7s.


ghstack-source-id: 3ef58a6
Pull-Request: #197657
d4l3k added a commit that referenced this pull request Sep 19, 2026
Share workers and the process group across the four initialization-info cases. Preserve the original rank cap and scoped environment patches; leave checkpoint process lifecycle tests unchanged.

Test plan: CUDA build and lint; four cases in normal/reverse order and one-visible-GPU CPU fallback; full six-test file postbuild. Four-case runtime improves from 22.2s to 5.7s.


ghstack-source-id: 3ef58a6
Pull-Request: #197657
d4l3k added a commit that referenced this pull request Sep 19, 2026
Share workers and the process group across the four initialization-info cases. Preserve the original rank cap and scoped environment patches; leave checkpoint process lifecycle tests unchanged.

Test plan: CUDA build and lint; four cases in normal/reverse order and one-visible-GPU CPU fallback; full six-test file postbuild. Four-case runtime improves from 22.2s to 5.7s.


ghstack-source-id: 3ef58a6
Pull-Request: #197657
@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

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-noble-rocm-py3.11-mi350 / test (default, 6, 8, amd-dpx-linux.rocm.gpu.gfx950.1)

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: trunk / linux-noble-rocm-py3.11-mi350 / test (default, 6, 8, amd-dpx-linux.rocm.gpu.gfx950.1)

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/152/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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants