-
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
[Refactor] Improve loops API 1/n #8334
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8334 +/- ##
=======================================
- Coverage 93% 88% -5%
=======================================
Files 214 216 +2
Lines 13914 14097 +183
=======================================
- Hits 12897 12404 -493
- Misses 1017 1693 +676 |
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.
TBH: I am not sure why we really need most of the stuff here. I left some comments, but IMO all the information about parents and children is not really required.
Hello @tchaton! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-07-12 09:47:46 UTC |
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.
Looks good to me overall. Just some comments
@@ -88,11 +102,7 @@ def run(self, *args: Any, **kwargs: Any) -> Optional[Any]: | |||
if self.skip: | |||
return self.on_skip() | |||
|
|||
if self.restarting: |
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.
So why do we not want the restarting
property anymore?
And why did you leave it in the __init__
?
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.
This is still used in reset self.restarting
. Check #8364.
Adrian convinced me it was cleaner to make it manual.
self.restarting is automatically set to True by the Trainer when calling loop load_state_dict
function.
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.
Where exactly is that PR setting restarting
on the loops?
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.
Hey @carmocca, right there: https://github.com/PyTorchLightning/pytorch-lightning/pull/8334/files#diff-4076755145b42e55247c8c12a7a7961a91f4d28a3e962c80a98161163bfa3ec9R205.
Each loop is going to load its own checkpoint and be put in restarting mode.
What does this PR do?
This PR adds functionalities to the loop similar to torch nn.Module for checkpointing.
Next PR: #8362
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
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 🙃