-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Avoid patching common DataHooks
to the LightningModule
#10603
Conversation
0a67469
to
3add38b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
dae8d5f
to
3adc0c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @rohitgr7 I'm ok with this update, thanks a lot for all the change! Would you add the warnings into the codebase as you proposed in the comment? Additionally, we currently have both _DataHookSource
and _DataLoaderSource
, could we simplify as just one? Afterall, *_dataloader
's are also data hooks, the purpose of source is providing a source of truth handling different overridden. Let me know what you think.
yes @ninginthecloud, I was going to propose this in a follow-up issue. Also, we need to ensure to have strict rules there:
else I think it would be really ambiguous to raise a warning for one hook if it's overridden in LM but not in LDM and not raise for another if it's overridden in LDM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
for more information, see https://pre-commit.ci
What does this PR do?
Fixes #10498
If any of these hooks are overridden in both model and datamodule, then we raise a warning and prioritize datamodule.
Does your PR introduce any breaking changes? If yes, please list them.
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃
cc @Borda @justusschock @awaelchli @rohitgr7 @carmocca @ananthsub @ninginthecloud @jjenniferdai @akihironitta