Add rounding error check to _maybe_log_save_evaluate
What does this PR do?
This PR aims to address the issue raised in #38032 by deciding the format in which the loss should be logged
Fixes # (issue) #38032
Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline] (https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request), Pull Request section? Yes
- [ ] Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case. https://github.com/huggingface/transformers/issues/38032#issuecomment-2953713166
- [ ] Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings. Yes
- [ ] Did you write any new necessary tests? No
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.
Hi @marcndo, there are a lot of unrelated changes in this PR! Can you make sure you rebase to the latest commit and try to limit the changes to just the relevant loss rounding lines?
Sure, I'll proceed with this right away
Looks okay to me now! cc @sunmarc
Certainly, I will proceed with this.
I tried the logging with wandb and it pointed out an issue logs["loss"] = str(round(log_eval), 4) instead of logs["loss"] = str(round(log_eval, 4)). After this fix the logging seems to work as expected here attached is a screenshot. I guess i should update the PR with this new fix.
I mean can the values be correctly displayed on the wandb table/website ? Also seems like there are some issues with changing it to an str. Another simple idea would be to just round it to 10 like logs["loss"] = round(log_eval, 10 when x < 1e-4, that should be enough precision
I'm not sure how to verify if the values are correctly displayed on the wandb table/website. Could you provide any guidance on how to confirm this, please?
Just use trainer with wandb installed, it will report the results to their website
Hi @SunMarc, please let me know if any modification is needed on this PR.
Hi @SunMarc, just wanted to kindly follow up on the PR to see if everything looks good now or if any further changes are needed. Thanks!