Skip to content

[distributed] Reuse workers for FSDP optimizer checkpoint tests - #197670

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

d4l3k wants to merge 4 commits into
gh/d4l3k/163/basefrom
gh/d4l3k/163/head

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

Reuse workers across optimizer checkpoint cases while preserving the combined CPU/accelerator backend, rank count and scoped subgroup cleanup.

Test plan: CUDA build and lint; three cases in normal and reverse order, with two GPUs, expected zero-GPU skips, and after rebuilding. Runtime fell from 17.4s to 6.6s.

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

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

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

  • Scope
    • Only test/distributed/checkpoint/test_fsdp_optim_state.py changes: base class, world_size, and the backend hook; both test bodies are untouched
    • No production code, public API, or CI workflow is touched
  • Base-class swap is sound
    • DTensorContinuousTestBase (common_dtensor.py:700) provides the backend_str classmethod hook the diff overrides in place of DTensorTestBase's backend property
    • _ensure_processes_spawned sets cls.world_size (common_distributed.py:2107) before calling backend_str (line 2111), so _get_device_type sees a resolved value
    • is_backend_available accepts the compound cpu:gloo,... string via its ":" branch at distributed_c10d.py:2020
  • Skips and cleanup preserved
    • _init_pg still exits with the multi-device skip code (common_dtensor.py:710-712), which _worker_loop converts to SkipTest (common_distributed.py:1978-1992)
    • with_comms is a passthrough here since no init_pg exists on this MRO, so the test's own dist.destroy_process_group(custom_pg) remains the subgroup cleanup
  • Established pattern
    • TestFullyShardSymmMem (test/distributed/_composable/fsdp/test_fully_shard_comm.py:1848) already pairs this base with @parametrize and instantiate_parametrized_tests
    • Sibling test/distributed/checkpoint/test_state_dict_utils.py:32 uses the same base plus with_comms and skip_if_lt_x_gpu

reason: clean
Reviewed commit: fd64b80

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:

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 added a commit that referenced this pull request Sep 19, 2026
Reuse workers across optimizer checkpoint cases while preserving the combined CPU/accelerator backend, rank count and scoped subgroup cleanup.

Test plan: CUDA build and lint; three cases in normal and reverse order, with two GPUs, expected zero-GPU skips, and after rebuilding. Runtime fell from 17.4s to 6.6s.


ghstack-source-id: 29c77f2
Pull-Request: #197670
d4l3k added a commit that referenced this pull request Sep 19, 2026
Reuse workers across optimizer checkpoint cases while preserving the combined CPU/accelerator backend, rank count and scoped subgroup cleanup.

Test plan: CUDA build and lint; three cases in normal and reverse order, with two GPUs, expected zero-GPU skips, and after rebuilding. Runtime fell from 17.4s to 6.6s.

ghstack-source-id: dcb4af3
Pull-Request: #197670
@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
Reuse workers across optimizer checkpoint cases while preserving the combined CPU/accelerator backend, rank count and scoped subgroup cleanup.

Test plan: CUDA build and lint; three cases in normal and reverse order, with two GPUs, expected zero-GPU skips, and after rebuilding. Runtime fell from 17.4s to 6.6s.

ghstack-source-id: dcb4af3
Pull-Request: #197670
d4l3k added a commit that referenced this pull request Sep 19, 2026
Reuse workers across optimizer checkpoint cases while preserving the combined CPU/accelerator backend, rank count and scoped subgroup cleanup.

Test plan: CUDA build and lint; three cases in normal and reverse order, with two GPUs, expected zero-GPU skips, and after rebuilding. Runtime fell from 17.4s to 6.6s.

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

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / macos-py3-arm64 / test (default, 2, 3, macos-m1-stable)

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 / macos-py3-arm64 / test (default, 2, 3, macos-m1-stable)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants