-
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
model checkpint on rank_zero_only & global rank state #1408
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1408 +/- ##
======================================
Coverage 89% 89%
======================================
Files 69 70 +1
Lines 4148 4138 -10
======================================
- Hits 3677 3670 -7
+ Misses 471 468 -3 |
b786a75
to
4da0b36
Compare
using the rank_zero decorator is maybe not a bad idea. it could be moved out of logger package to a more general package. and the ModelCheckpoint could get a rank property. |
Hello @Borda! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-04-24 20:53:37 UTC |
00ed890
to
a29a0da
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.
I think there are a few changes here that can break functionality.
I'd prefer @neggert to look at this closer since he spent a long time on this a while back
This pull request is now in conflict... :( |
changelog need to be rebased on new release #1419 |
afb989f
to
f2c3b92
Compare
This pull request is now in conflict... :( |
8d6e5d3
to
b101025
Compare
ef104b8
to
7d1c9a6
Compare
This pull request is now in conflict... :( |
@Borda I saw the problem with my proposal and fixed it in my branch here: |
f3e55f0
to
d0352ae
Compare
@williamFalcon updated with @awaelchli |
This pull request is now in conflict... :( |
try: | ||
# add the attribute to the function but don't overwrite in case Trainer has already set it | ||
getattr(rank_zero_only, 'rank') | ||
except AttributeError: | ||
rank_zero_only.rank = 0 |
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.
try: | |
# add the attribute to the function but don't overwrite in case Trainer has already set it | |
getattr(rank_zero_only, 'rank') | |
except AttributeError: | |
rank_zero_only.rank = 0 | |
# add the attribute to the function but don't overwrite in case Trainer has already set it | |
rank_zero_only.rank = getattr(rank_zero_only, 'rank', 0) |
I added the try catch block but this is probably more elegant :)
Before submitting
What does this PR do?
Fixes #1366. As suggested in the issue
MOreover it it defines global proc rank so no instance needs to carry it...
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃