-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[RFC] Deprecate on_pretrain_routine_start
and on_pretrain_routine_end
LM/callback hooks
#10984
Comments
I have suggested some users over slack #questions to use these hooks for their use-case because
not sure if |
good catch. it should just be another weird thing with these hooks now is that there is nothing that happens between similarly, this could be run in |
yeah good call, updated the description.
yeah agreed. I think between |
tbh I don't recall the actual use-case, I can't find them either since we have 10K limit for messages on slack. I am ok if these could be collapsed into one. I don't use this hook often. If everyone else agrees, I am ok with deprecation too. |
Ok, let's see what other people think about deprecation |
Looking at their position here I'd say I'm not sure at the moment whether they should be removed (after a deprecation ofc), but they sure could be collapsed into one hook. This proposal is also missing links for (1): The issue/PR that added them. You can use |
Added both to the issue. From the grep.app search, it does seem to me that these usages could be replaced by |
@tchaton what do you think about deprecating these hooks? |
Hey @daniellepintz. Great question. I can see Bolt and other repos use it, but we should incentivize for cleaner code. So I am in favor of the depreciation. |
Me too |
For anyone who wants to pick up this issue, here is an example PR to follow: #10940 |
I would like to work on this |
@krishnakalyan3 Assigned to you, thanks!! |
Reopening since we still need to do the LM hooks |
Proposed refactor
Deprecate these hooks:
https://github.com/PyTorchLightning/pytorch-lightning/blob/6369e3b77fa3f38613b661517f6361f842f611c9/pytorch_lightning/trainer/trainer.py#L1261-L1269
Motivation
Users can use
on_train_start
,on_fit_start
, orsetup
for the same purpose.Additional Context
These hooks were originally added in #2850
I see about 30 usages of each hook using grep.app:
https://www.grep.app/search?q=on_pretrain_routine_start
https://www.grep.app/search?q=on_pretrain_routine_end
Part of #7740
Carries forward discussion #9043 on these hooks
cc @Borda @tchaton @rohitgr7 @carmocca @awaelchli @ninginthecloud @daniellepintz
The text was updated successfully, but these errors were encountered: