Skip to content

Fixes DefaultStager crash when reused - #183424

Closed
arkadip-maitra wants to merge 1 commit into
pytorch:mainfrom
arkadip-maitra:fix_183413
Closed

arkadip-maitra wants to merge 1 commit into
pytorch:mainfrom
arkadip-maitra:fix_183413

Conversation

@arkadip-maitra

Copy link
Copy Markdown
Collaborator

Fixes #183413

DefaultStager stopped being reusable because DefaultStager._stage() closed its internal StateDictStager after every stage, because of my earlier pr #170431 that fixed issue #170163

This fixes that by keeping user provided stagers alive across saves and moving cleanup of internally created default stagers into async_save(). Added test to verify re-usability of DefaultStager and verified to regression.

@pytorch-bot

pytorch-bot Bot commented May 12, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/183424

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 003dfc4 with merge base e8fdac8 (image):

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

BROKEN TRUNK - The following job failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot

pytorch-bot Bot commented May 12, 2026 •

Copy link
Copy Markdown

Workflows were awaiting approval. CI has now been triggered for the ciflow labels on this PR.

@arkadip-maitra
arkadip-maitra marked this pull request as ready for review May 12, 2026 11:22
@arkadip-maitra arkadip-maitra changed the title Fixes DefaultStagercrashing when reused Fixes DefaultStager crash when reused May 13, 2026
@arkadip-maitra
arkadip-maitra requested a review from aditvenk May 13, 2026 06:26
@zou3519 zou3519 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label May 14, 2026
@fegin fegin added the ciflow/trunk Trigger trunk jobs on your pull request label Jun 1, 2026
@fegin

fegin commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

@pytorchbot merge

@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 mandatory check(s) failed. The first few are:

Dig deeper by viewing the failures on hud

Details for Dev Infra team Raised by workflow job

Failing merge rule: Core Maintainers

@arkadip-maitra

Copy link
Copy Markdown
Collaborator Author

@pytorchbot rebase

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Successfully rebased fix_183413 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout fix_183413 && git pull --rebase)

@arkadip-maitra

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@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

gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
Fixes pytorch#183413

DefaultStager stopped being reusable because DefaultStager._stage() closed its internal StateDictStager after every stage, because of my earlier pr [pytorch#170431](pytorch#170431) that fixed issue pytorch#170163

This fixes that by keeping user provided stagers alive across saves and moving cleanup of internally created default stagers into `async_save()`.  Added test to verify re-usability of `DefaultStager` and verified to regression.
Pull Request resolved: pytorch#183424
Approved by: https://github.com/fegin
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
Fixes pytorch#183413

DefaultStager stopped being reusable because DefaultStager._stage() closed its internal StateDictStager after every stage, because of my earlier pr [pytorch#170431](pytorch#170431) that fixed issue pytorch#170163

This fixes that by keeping user provided stagers alive across saves and moving cleanup of internally created default stagers into `async_save()`.  Added test to verify re-usability of `DefaultStager` and verified to regression.
Pull Request resolved: pytorch#183424
Approved by: https://github.com/fegin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/torchtitan Run TorchTitan integration tests ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: distributed (checkpoint) triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DefaultStager crashes with KeyError: <class 'type'> when reused across multiple async_save calls

5 participants