-
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
Ignore step
param in Neptune logger's log_metric method
#5510
Conversation
The `step` parameter is ignored because Neptune requires strictly increasing step values, a condition which is sometimes violated in Lighting e.g. when `fit()` and `test()` are called one after another on some models. `step` could be enabled again once Lightning guarantees that step values are always strictly increasing. Also a minor bugfix: the `log_text()` method should use Neptune's `log_text()` method.
# `step` is ignored because Neptune expects strictly increasing step values which | ||
# Lighting does not always guarantee. | ||
self.log_metric(key, val) |
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.
It normally is, unless user adds new logs manually then the neptune's internal step may increase while lightning's step does not.
it's probably the same as in WandB logger, see #5194
if more flexibility is needed in the future, we could consider something similar as proposed in #5351
Note: the global step in Lightning should not increase during val or test. It is not a bug.
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.
Thanks for this comment - could you just have a look at this related issue (and the specific linked comment) and confirm that this behaviour of PTL is expected? #5130 (comment)
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.
In reply to the comment in the link:
Multiple calls to fit will not reset the global step. However, if the user creates a new trainer after fit and then calls fit again on the new trainer, this one will start from global step 0 (but then this would probably also create a new neptune experiment)
Using global step for logging is one possibility. I understand that some loggers may want to resume and append new data points with a monotonic step. I think that's perfectly fine. If the usability of Neptune benefits from tracking an internal step separate from Trainers global step, then that should be fine in my opinion. However, the user should be careful, because if they do multiple log calls per actual training step, they may run into issues comparing experiments across runs because the step axes don't match up.
Let's treat this as an api change? or do you see this as a bugfix? Is there a related issue that we need to link? |
I suppose it could be viewed as the latter (a bugfix). The API stays the
same in terms of function signatures, and the behavior changes in a very
minor way - I don't think many users rely on steps numbering for anything
critical (but I might be mistaken of course).
…On Thu, Jan 14, 2021 at 3:23 PM Adrian Wälchli ***@***.***> wrote:
Let's treat this as an api change? or do you see this as a bugfix?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5510 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACK76PQDAUYWWITT2GC2YZDSZ347PANCNFSM4WCFLIHA>
.
|
What's left to do is you need to adjust the two tests: |
I did fix (or tried to fix) the test you mentioned but the CI reports shows many unrelated tests failing, and I'm not sure I can determine whether all relevant tests are passing now. But if they do, then please let me know and I'll merge this. |
@PiotrJander I fixed the tests. Have a look. The remaining failures do not originate from this PR. |
Codecov Report
@@ Coverage Diff @@
## master #5510 +/- ##
======================================
Coverage 93% 93%
======================================
Files 135 135
Lines 10005 10005
======================================
Hits 9339 9339
Misses 666 666 |
* Ignore `step` param in Neptune logger's log_metric method The `step` parameter is ignored because Neptune requires strictly increasing step values, a condition which is sometimes violated in Lighting e.g. when `fit()` and `test()` are called one after another on some models. `step` could be enabled again once Lightning guarantees that step values are always strictly increasing. Also a minor bugfix: the `log_text()` method should use Neptune's `log_text()` method. * Update neptune.py * Update test_neptune.py * Update test_all.py * fix neptune tests * add chlog Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Nicki Skafte <[email protected]> (cherry picked from commit 5d76b31)
* Ignore `step` param in Neptune logger's log_metric method The `step` parameter is ignored because Neptune requires strictly increasing step values, a condition which is sometimes violated in Lighting e.g. when `fit()` and `test()` are called one after another on some models. `step` could be enabled again once Lightning guarantees that step values are always strictly increasing. Also a minor bugfix: the `log_text()` method should use Neptune's `log_text()` method. * Update neptune.py * Update test_neptune.py * Update test_all.py * fix neptune tests * add chlog Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Nicki Skafte <[email protected]> (cherry picked from commit 5d76b31)
* Ignore `step` param in Neptune logger's log_metric method The `step` parameter is ignored because Neptune requires strictly increasing step values, a condition which is sometimes violated in Lighting e.g. when `fit()` and `test()` are called one after another on some models. `step` could be enabled again once Lightning guarantees that step values are always strictly increasing. Also a minor bugfix: the `log_text()` method should use Neptune's `log_text()` method. * Update neptune.py * Update test_neptune.py * Update test_all.py * fix neptune tests * add chlog Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Nicki Skafte <[email protected]> (cherry picked from commit 5d76b31)
* Ignore `step` param in Neptune logger's log_metric method The `step` parameter is ignored because Neptune requires strictly increasing step values, a condition which is sometimes violated in Lighting e.g. when `fit()` and `test()` are called one after another on some models. `step` could be enabled again once Lightning guarantees that step values are always strictly increasing. Also a minor bugfix: the `log_text()` method should use Neptune's `log_text()` method. * Update neptune.py * Update test_neptune.py * Update test_all.py * fix neptune tests * add chlog Co-authored-by: Adrian Wälchli <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Nicki Skafte <[email protected]> (cherry picked from commit 5d76b31)
What does this PR do?
The
step
parameter is ignored inlog_metrics()
because Neptune requires strictly increasing step values, a condition which is sometimes violated in Lighting e.g. whenfit()
andtest()
are called one after another on some models.step
could be enabled again once Lightning guarantees that step values are always strictly increasing.Also a minor bugfix: the
log_text()
method should use Neptune'slog_text()
method.Fixes #5130
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 🙃