-
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
deprecate on_{train/val/test/predict}_dataloader()
from DataHooks
#9098
deprecate on_{train/val/test/predict}_dataloader()
from DataHooks
#9098
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9098 +/- ##
=======================================
- Coverage 92% 88% -4%
=======================================
Files 176 176
Lines 14804 14828 +24
=======================================
- Hits 13651 13056 -595
- Misses 1153 1772 +619 |
on_{train/val/test/predict}_trainer()
from DataHookson_{train/val/test/predict}_dataloader()
from DataHooks
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.
very nice! i only have some minor comments
pytorch_lightning/trainer/connectors/logger_connector/fx_validator.py
Outdated
Show resolved
Hide resolved
Summary: 1. remove `on_{train/val/test/predict}_dataloader()` 2. update corrsonding tests Test Plan: make test
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
Summary: 1. check overridden in configuration_validator.py 2. add unit test to catch deprecation warning 3. update hooks docstring Test Plan: Reviewers: Subscribers: Tasks: Tags:
for more information, see https://pre-commit.ci
8dc7a89
to
29474af
Compare
2c35b67
to
c2e046c
Compare
Hey @ananthsub @ninginthecloud, Let's wait a little for this one. I want to make sure we can find an alternative for Flash as those hooks are currently the cleanest way to modify in-place dataloaders on reset. @ethanwharris Mind looking into this ? Best, |
Co-authored-by: ananthsub <[email protected]>
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! Still awaiting @tchaton's comment
Could we not just migrate to using the val/train/test/predict dataloader hook?
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, flash is no longer dependent on this following: Lightning-Universe/lightning-flash#707
Co-authored-by: ananthsub <[email protected]>
for more information, see https://pre-commit.ci
What does this PR do?
Context
Fixes #8758
DataHooks has defined
on_{train/val/test/predict}_dataloader
, but these functions ususally are called right before{train/val/test/predict}_dataloader
. It's difficult for users to distinguish these two sets of hooks. As discussed in issue #8758 (detailed discussion here), it's aligned that we can deprecate this set of hooks.Steps
on_{train/val/test/predict}_dataloader
from DataHookstest_dataloaders.py
andtest_hooks.py
fx_validator.py
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 🙃