-
Notifications
You must be signed in to change notification settings - Fork 31.3k
Disable loss rounding in training stats log #42104
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
Conversation
686b9df to
45fa1e7
Compare
|
cc @SunMarc, but maybe formatting using something like |
|
@Rocketknight1 Any rounding at this point introduces inconsistency between validation and training loss. We could not apply formatting here as we log numeric value, not string. The main point is that any formatting is a representation detail that should be handled by the display-related code and we should not make assumptions on how it works as in most cases it is some external handler (wandb, trackio, ipython NB widget, etc.). |
|
Please, take a look |
SunMarc
left a 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.
I don't mind merging this PR. I also saw a couple of issues before complaining about this. cc @stas00 as this is something you added way back
|
This use case didn't exist when this was originally coded. The goal was to avoid a pointless output like I wonder if using a scientific notation can address this use-case while not making it an ugly experience for all other use cases. |
At this point these are still numeric values so we can't apply formatting, see #42104 (comment) |
|
Apply at the point of print then, while saving the full precision in the log file? |
There are multiple ways of how the values could be displayed - jupyter notebooks, reporting to wandb, trackio, etc. Each handles display rounding separately. See attached screenshots in the first message here. This PR makes this behaviour explicit and consistent across different type of values/metrics. If there is a benefit of rounding the metric in specific logs - it could be added in a separate PR. |
|
Whatever works. To make it clear - I wasn't objecting to your PR, was just suggesting on possible further work to keep things neat for multiple use-cases since I was tagged as the originator of this "feature". |
|
Sure, just clarified the intention. Thanks! @SunMarc Could you merge please? |
45fa1e7 to
05a8b5e
Compare
|
To not have regression for other users, maybe we can implement @Rocketknight1 suggestions in
Thanks a lot @stas00 for the suggestion |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
05a8b5e to
e745b00
Compare
SunMarc
left a 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.
Much better, thank you !
|
Updated the PR to format metrics in console with 4 significant digits. Example output: Note - epoch formatted the same way for consistency. |
|
that looks great, except Should it report the percentage of epoch progress? |
|
Percentage would not work for second+ epoch. |
|
why not? |
|
But please feel free to ignore my suggestions if the current maintainers are ok with your last proposal. They decide. |
|
I think we can keep this for now. If ppl complains about that, we can still do follow-up pr for specific metrics |
This PR disables unconditional rounding of the loss value to 4 digits in logged values. Effectively reverting part of #9491.
Closes #38032 (stale)
Motivation:
Examples of undesired behavior that would be fixed with this PR:
Notebook outputs:

Wandb loss chart:
