-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat: add new callback hook on_checkpoint_write_end
#21323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: add new callback hook on_checkpoint_write_end
#21323
Conversation
|
Hi @Iruos8805, I noticed there’s an pytorch-lightning/src/lightning/pytorch/loggers/logger.py Lines 31 to 36 in 32442c2
Would this method already address the issue being discussed here? |
|
They serve different purposes according to my understanding.
|
What does this PR do?
This PR introduces a new callback hook,
on_checkpoint_write_end, which is triggered after a checkpoint file has been fully written to disk.It allows users to run custom logic such as validation, integrity checks, or post save actions once checkpoint writing is complete.
Currently,
on_save_checkpointis triggered before the checkpoint file is written to disk.However, there is no callback hook that runs after the checkpoint write operation is fully complete.
This limitation makes it difficult to safely perform actions that depend on the finalized checkpoint file, such as:
The motivation behind this change is to enable developers to reliably run logic only after the checkpoint is guaranteed to exist on disk.
Fixes #15795
Before submitting
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
📚 Documentation preview 📚: https://pytorch-lightning--21323.org.readthedocs.build/en/21323/