Skip to content

[distributed] Reuse checkpoint ordering test workers - #197704

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

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

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Stack from ghstack (oldest at bottom):

Move ordering and overwrite checks unchanged into a continuous-worker class. Keep compiler, asynchronous checkpoint and uninitialized-distributed tests on the existing harness. Preserve rank limits and the combined CPU/accelerator backend.

Test plan: CUDA build and lint; ordering/overwrite tests in normal and reverse order, expected CPU/two-GPU skips, plus original no-distributed, stateful loading, backend rejection and initialization regressions. Two-test runtime drops from 11.433s to 5.631s.

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

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

❌ 1 Cancelled Job

As of commit 38655ec with merge base b7954b2 (image):

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

  • Scope
    • Test-only change to test/distributed/checkpoint/e2e/test_e2e_save_and_load.py; no torch/ source or workflow file is touched
    • The diff is a pure move: test_no_dist/test_partial_load relocate up into TestE2ESaveAndLoad, and test_different_ordered_state_dict_keys/test_overwrite become methods of the new TestCheckpointOrderingAndOverwrite, with no body edits
  • Harness correctness
    • TestCheckpointOrderingAndOverwrite(DTensorContinuousTestBase) follows the precedent already used by TestStateDictUtils in test/distributed/checkpoint/test_state_dict_utils.py, which also stacks @with_comms on that base
    • with_comms passes through harmlessly here: its hasattr(self, "init_pg") guard in common_dtensor.py:894 is false because init_pg is defined only on DTensorTestBase, not on the continuous base
    • skip_if_lt_x_gpu(4) still skips correctly under the worker model — it calls sys.exit in common_distributed.py:319, which _worker_loop maps back to unittest.SkipTest at common_distributed.py:1978-1992
  • Preserved behavior
    • Rank limits hold: world_size = NUM_DEVICES matches the DTensorTestBase.world_size property it replaces (common_dtensor.py:791)
    • The combined CPU/accelerator backend survives: the backend_str override returns cpu:gloo,{device}:{backend}, and is_backend_available handles composite strings at distributed_c10d.py:2020
    • self.temp_dir still resolves — with_temp_dir broadcasts from rank 0 when dist.is_initialized(), which holds inside the continuous workers
  • Coverage
    • No assertion or test is dropped; both moved tests keep only assertTrue/assertRaisesRegex, so the VerifyStateDictMixin helpers left behind on TestE2ESaveAndLoad are not needed by the new class
    • instantiate_parametrized_tests(TestE2ESaveAndLoad) stays correct since the new class declares no @parametrize

reason: clean
Reviewed commit: 38655ec

Inference job

🐛 Report a wrong verdict

CANCELLED JOB - The following job was cancelled. Please retry:

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

Starting merge as part of PR stack under #197705

pytorchmergebot pushed a commit that referenced this pull request Sep 19, 2026
Reuse workers for FLEX and SDPA input-argument tests, preserving two ranks and all mock, layout, and value assertions. Keep attention execution and sharding-registration tests on their existing fixtures.

Test plan: CUDA build and lint; eight tests in normal/reverse order and CPU/single-visible-GPU fallback. Runtime drops from 38.086s to 9.019s; reverse 8.716s.
Pull Request resolved: #197705
Approved by: https://github.com/pytorchgreenlight
ghstack dependencies: #197647, #197648, #197703, #197704
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

xjbanana258 added a commit to xjbanana258/pytorch that referenced this pull request Oct 13, 2026
Rebased onto latest main, resolving conflicts with pytorch#197704 and pytorch#195952:
TestCheckpointOrderingAndOverwrite (upstream) now owns
test_different_ordered_state_dict_keys and test_overwrite, so this PR
no longer moves test_overwrite into TestInitStateDict, and
test_different_ordered_state_dict_keys keeps only the
device_type = self.device_type fix on top of upstream's copy.

Review fixes for can-gaa-hou's latest comments:

TestNoCPU is now classified ACCELERATOR instead of GENERIC. With pytorch#195952
landed, its backend resolves via get_default_backend_for_device and the
test is gated by skip_if_lt_x_gpu(NUM_DEVICES), so it is
accelerator-generic rather than CUDA-specific; GENERIC contradicted both
the skip gating and the taxonomy.

except_for=("cpu",) is removed from instantiate_device_type_tests. It
was requested by fffrog earlier but reintroduced by a later commit.
Every test method in TestE2ESaveAndLoad is gated by
skip_if_lt_x_gpu(4), so CPU variants skip cleanly without it.

TestCheckpointOrderingAndOverwrite is annotated ACCELERATOR for
consistency with the rest of this file.

Assisted-by: Claude (Anthropic)

Test Plan:
- python3 -m py_compile test/distributed/checkpoint/e2e/test_e2e_save_and_load.py
- ruff check --config pyproject.toml test/distributed/checkpoint/e2e/test_e2e_save_and_load.py
- CI on the PR (4-GPU distributed suites).
@github-actions
github-actions Bot deleted the gh/d4l3k/190/head branch November 24, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants