-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
[finetune_trainer] enhancements and fixes #9042
Conversation
Unfortunately the naming has been done a long time ago and even if it's not ideal, we can't break it like this as people rely on the names of the keys in their code. I would advocate for the renaming to be done in the script directly and not inside If there is really a lot of people asking for it, we can think of a strategy to rename those keys progressively with some kind of deprecation warning, but since it's merely cosmetic, I would leave that for scripts using Trainer. |
I see what you mean that someone relying on "eval_loss" when doing predict would have their code broken. Yes, we can't do that. Could we set a a target for when we could do breaking changes and fix this bug? I also find it strange that we use And then The callbacks are inconsistent too :( I'd plan a design session where we first collect all the rough edges and inputs on what needs to be polished and then adjust the trainer so that it's not limping for the rest of its life. Can this be done? |
Like I said, unless there is strong demand for it, I think we're just going to leave it as it. It's not the ideal naming choice but we have to deal with it now (kind of like PretrainedConfig vs PreTrainedConfig).
I don't understand that part. Also
Could you elaborate? If it's the evaluate vs predict you mentioned, there is a reason. |
I'm not sure how this is similar. I call
I suppose from the perspective of the existing trainer like finetune they are the same. But surely this is much less of an issue than
Ah, I see, thank you for clarifying that - then why is there no |
There is no
Could you please clarifying that part? I'm not sure what you mean by this.
If we go down that road, I can get behind adding a prefix argument to those method that defaults to |
Of course, we have So now that you have further expanded on eval+predict not being correlated to validation+testing (thank you!), I think I'm not approaching the problem in the right way. Really, then there is no bug with both
So if my logic makes sense practically we can either:
Probably the 1st one is simpler, since it gives the user full flexibility. The same should happen to the results file naming - we need to choose whether those are |
If you're happy with |
OK, 3 follow up questions:
What do you think @patrickvonplaten + @patil-suraj? I think @sgugger's priority is the trainer itself, but what do you think about what would be ideal for seq2seq examples domain? |
For 1, yes |
@sgugger, please have a look - do we want None as the default and use |
And so then the only remaining thing that I'm stuck with - do we call the results of I think they should be |
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.
Looking good, thanks a lot! I have a few comments but nothing really important.
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
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.
Trying to get clearer, let me know if I managed or if I should just call it a day for today ;-)
As the comments issue is unrelated to this PR - how about I just let you edit those comments as you think would be the best, @sgugger. Anything you choose works for me. Thank you. |
It doesn't look like others are going to review this PR. I didn't want to force anybody by asking to review, just tagging. Is it better to ask for a review explicitly? @sgugger, please let me know if you still want to adjust unrelated to this PR comments or should I merge it and you will deal with it later. Thank you! |
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.
Left some nits
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Thank you, @patrickvonplaten! I went on and removed the |
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
So that was wrong - thank you for fixing that, @sgugger
|
The main need was to add speed metrics to perform speed performance regressions. But on the way a bunch of other things got worked on. Hopefully you will find the proposed changes useful.
This PR change
trainer
metric_key_prefix
forevaluate
andpredict
functions to return metrics with a prefix key set by the user rather than the defaulteval_
.This PR change
finetune_trainer
"eval_loss": 368.2950744628906,
- not sure if it's better done upstream in the trainer?Here is a sample of
all_results.json
after this change:@sgugger, @patil-suraj, @patrickvonplaten