-
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
feat(wandb): offset logging step when resuming #5050
Conversation
Hello @borisdayma! Thanks for updating this PR.
Comment last updated at 2020-12-19 12:33:15 UTC |
Codecov Report
@@ Coverage Diff @@
## master #5050 +/- ##
======================================
Coverage 93% 93%
======================================
Files 134 134
Lines 9928 9933 +5
======================================
+ Hits 9242 9247 +5
Misses 686 686 |
Co-authored-by: Adrian Wälchli <[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.
can we add a test for the multiple call?
Co-authored-by: Jirka Borovec <[email protected]>
@Borda Sure, you're talking about the warning? |
@Borda I added a test for warnings displayed. |
pytorch_lightning/loggers/wandb.py
Outdated
@@ -154,6 +161,9 @@ def log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None) -> | |||
assert rank_zero_only.rank == 0, 'experiment tried to log from global_rank != 0' | |||
|
|||
metrics = self._add_prefix(metrics) | |||
if not self.WARNING_DISPLAYED and (step is not None and step + self._step_offset < self.experiment.step): |
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 we have a better way to handle only once displayed Warning. Could be WarningCache. Need to check.
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'm now using Edit: looks like I can use |
I was able to make the tests work with |
* feat(wandb): offset logging step when resuming * feat(wandb): output warnings * fix(wandb): allow step to be None * test(wandb): update tests * feat(wandb): display warning only once * style: fix PEP issues * tests(wandb): fix tests * tests(wandb): improve test * style: fix whitespace * feat: improve warning Co-authored-by: Adrian Wälchli <[email protected]> * feat(wandb): use variable from class instance Co-authored-by: Jirka Borovec <[email protected]> * tests(wandb): check warnings * feat(wandb): use WarningCache * tests(wandb): fix tests * style: fix formatting Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
* feat(wandb): offset logging step when resuming * feat(wandb): output warnings * fix(wandb): allow step to be None * test(wandb): update tests * feat(wandb): display warning only once * style: fix PEP issues * tests(wandb): fix tests * tests(wandb): improve test * style: fix whitespace * feat: improve warning Co-authored-by: Adrian Wälchli <[email protected]> * feat(wandb): use variable from class instance Co-authored-by: Jirka Borovec <[email protected]> * tests(wandb): check warnings * feat(wandb): use WarningCache * tests(wandb): fix tests * style: fix formatting Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
* feat(wandb): offset logging step when resuming * feat(wandb): output warnings * fix(wandb): allow step to be None * test(wandb): update tests * feat(wandb): display warning only once * style: fix PEP issues * tests(wandb): fix tests * tests(wandb): improve test * style: fix whitespace * feat: improve warning Co-authored-by: Adrian Wälchli <[email protected]> * feat(wandb): use variable from class instance Co-authored-by: Jirka Borovec <[email protected]> * tests(wandb): check warnings * feat(wandb): use WarningCache * tests(wandb): fix tests * style: fix formatting Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
* feat(wandb): offset logging step when resuming * feat(wandb): output warnings * fix(wandb): allow step to be None * test(wandb): update tests * feat(wandb): display warning only once * style: fix PEP issues * tests(wandb): fix tests * tests(wandb): improve test * style: fix whitespace * feat: improve warning Co-authored-by: Adrian Wälchli <[email protected]> * feat(wandb): use variable from class instance Co-authored-by: Jirka Borovec <[email protected]> * tests(wandb): check warnings * feat(wandb): use WarningCache * tests(wandb): fix tests * style: fix formatting Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
* feat(wandb): offset logging step when resuming * feat(wandb): output warnings * fix(wandb): allow step to be None * test(wandb): update tests * feat(wandb): display warning only once * style: fix PEP issues * tests(wandb): fix tests * tests(wandb): improve test * style: fix whitespace * feat: improve warning Co-authored-by: Adrian Wälchli <[email protected]> * feat(wandb): use variable from class instance Co-authored-by: Jirka Borovec <[email protected]> * tests(wandb): check warnings * feat(wandb): use WarningCache * tests(wandb): fix tests * style: fix formatting Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
What does this PR do?
When resuming a run, the step was not being offset to account for previous logged data.
It will now be correctly offset.
In addition, I took advantage to give users a hint when they have related issues trying to log "back in time". It is usually due to them logging manually other data (images, etc) and causing the wandb step to automatically increase. This will close wandb/wandb#1507
I added the same details in the documentation.
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 🙃