Skip to content

fix: PermissionError swallowing in _atomic_save#21799

Open
zhixiangli wants to merge 2 commits into
Lightning-AI:masterfrom
zhixiangli:fix-fsdp-permission-error-swallowing
Open

fix: PermissionError swallowing in _atomic_save#21799
zhixiangli wants to merge 2 commits into
Lightning-AI:masterfrom
zhixiangli:fix-fsdp-permission-error-swallowing

Conversation

@zhixiangli

@zhixiangli zhixiangli commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #21800

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

_atomic_save was silently swallowing non-cross-device PermissionErrors.
This caused FSDP saves to silently fail (e.g. on permission denied writes
to a bucket or read-only mount) while reporting success.

We now re-raise the PermissionError if it is not the specific EXDEV
cross-device error.

TAG=agy
CONV=6de87715-4fba-4a08-be33-6aa377349f77
@zhixiangli zhixiangli marked this pull request as ready for review July 3, 2026 10:13
@zhixiangli zhixiangli changed the title Fix PermissionError swallowing in _atomic_save fix: PermissionError swallowing in _atomic_save Jul 3, 2026
@codecov-commenter

codecov-commenter commented Jul 3, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87%. Comparing base (4819088) to head (b06d9b9).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21799   +/-   ##
=======================================
  Coverage      87%      87%           
=======================================
  Files         270      270           
  Lines       24010    24011    +1     
=======================================
+ Hits        20787    20789    +2     
+ Misses       3223     3222    -1     

@zhixiangli zhixiangli marked this pull request as draft July 3, 2026 14:54
@zhixiangli zhixiangli marked this pull request as ready for review July 4, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Checkpoints silently fail to save due to swallowed PermissionError in _atomic_save

2 participants