-
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
Add a flavor of training_step that takes dataloader_iter as an argument #8807
Add a flavor of training_step that takes dataloader_iter as an argument #8807
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8807 +/- ##
=======================================
- Coverage 93% 89% -4%
=======================================
Files 173 176 +3
Lines 14182 14268 +86
=======================================
- Hits 13174 12678 -496
- Misses 1008 1590 +582 |
0fb8317
to
81a8010
Compare
9f78849
to
2297f23
Compare
a2bc359
to
1cec6f8
Compare
Hello @yifuwang! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2021-08-12 21:17:43 UTC |
Just catching up here, but by introducing a method to allow the dataloader to be passed into the training step, we're bypassing a loop, migrating the loop into the training step right? If so I think I understand @tchaton concerns of it being a risky hole to delve into without care. Shouldn't the logic exist within a loop past into Trainer or as done within #8700? |
Dear @yifuwang @ananthsub @carmocca @awaelchli @justusschock @williamFalcon @SeanNaren @kaushikb11 @Borda After chatting with @yifuwang, I understood there is some urgency on this feature to enable converting libraries to PL. However, the plan would be to start replacing this as soon as it is merged in follow-ups PRs by introducing a The @yifuwang committed to co-author the refactor once this PR has been merged starting from the works within #8476 and #8700. So let's get this PR merged asap :) Best, |
Hi Thomas, thanks for the review and feedback! I'm fully onboard with enabling this through a broader design for data prefetching use cases (i.e. #8700). I'll be committed to helping execute the direction and replacing this before the next release. |
@tchaton I agree, thank you for summarizing this! I'll also echo @yifuwang 's comment here as well!
+1000 |
Thanks @ananthsub @yifuwang for confirming :) IMO, Here is the scope around the refactoring:
Finally, I created an RFC for the refactor re-design. |
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.
premature accept due to urgency
I do not fully understand what's going on here. I hope there is still a bit of time for us to test it.
I trust that we will follow up with meetings and discussions with how all of this fits into Lightnings philosophy. Ideally the order would be the other way around.
13a03c7
to
377a340
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 !
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.
agreed with the feedback, and that this is just the start for how:
- we can build a foundation around how the trainer interacts with the training step (and especially multiple flavors of training steps)
- how we can bring better clarity to the individual batch loops, so the code is straightforward to read for both developers and users, especially those coming from pure pytorch training
- how we can better select which loops to run based on the trainer & module attributes
…nt (#8807) * Add a flavor of training_step that takes dataloader_iter as an argument
What does this PR do?
Implements the feature request #8316
Introduced
FlexibleOptimizationFlow
, which is a "batch processor" alternative toTrainingBatchLoop
when thetraining_step
takesdataloader_iter
as an argument.New tests are WIP.
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 🙃