-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
callbackdesignIncludes a design discussionIncludes a design discussionfeatureIs an improvement or enhancementIs an improvement or enhancementgood first issueGood for newcomersGood for newcomerswon't fixThis will not be worked onThis will not be worked on
Description
🚀 Feature
Create the after_save_checkpint hook for Callback in the same fashion as the hook in the logger.
Motivation
In our group, we will create a symlink whenever a better checkpoint is saved, so the automated scripts in the background can find the right checkpoint to start their job. Our in-house framework will handle the symlinks, but I find no entry point after we moved to Pytorch Lightning to implement the same feature.
Pitch
A callback hook e.g., Callback.after_save_checkpoint so users can define their custom tasks whenever a better checkpoint is saved. For example:
class UpdateBestCheckpointCB(Callback):
def after_save_checkpint(self, trainer, pl_module, **others):
update_symlink_to_best(trainer)
Alternatives
For now, we can always regard the latest checkpoint as the best, but it will be better if I can be sure about which is the best one.
awaelchli, dcx and oleg-panichevrohitgr7
Metadata
Metadata
Assignees
Labels
callbackdesignIncludes a design discussionIncludes a design discussionfeatureIs an improvement or enhancementIs an improvement or enhancementgood first issueGood for newcomersGood for newcomerswon't fixThis will not be worked onThis will not be worked on