Customizing model checkpointing logic #9629
Unanswered
ZhaofengWu
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 3 replies
-
Could you describe what functionality you'd like to add during checkpointing? This would help us determine a recommendation for which component to look at extending |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I don't think overriding
ModelCheckpoing.save_checkpoint()
is the best idea, since it contains logic such as finding topk, etc. I then traced down the code fromModelCheckpointCallback
, and eventually ended up atTrainingTypePlugin
, and specifically itslightning_module_state_dict()
method which seems like what I should inherit, overload, and pass to theTrainer
's constructor as a plugin. However, which class should I inherit from? The genericTrainingTypePlugin
? A specific subclass such asSingleDevicePlugin
? Neither sound general enough.On the other hand, I'm inclined to directly override
state_dict()
, but I worry that it might be used for purposes other than checkpointing and might cause silent bugs.This might be related to #9627.
Beta Was this translation helpful? Give feedback.
All reactions