-
Notifications
You must be signed in to change notification settings - Fork 31.1k
fix num_assistant_tokens with heuristic schedule #28759
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
fix num_assistant_tokens with heuristic schedule #28759
Conversation
gante
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.
Thank you for the fix and the tests 💛
Co-authored-by: Joao Gante <[email protected]>
Co-authored-by: Joao Gante <[email protected]>
check that candidate_generator.assistant_model exists since some some speculations (like ngram and PLD) don't have assistant_model attribute
ArthurZucker
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.
Thanks for the PR!
Co-authored-by: Arthur <[email protected]>
amyeroberts
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.
Thanks for adding this!
For the code quality checks, you'll need to run make fixup and push the changes.
From the docstring, it mentions behaviour about `"heuristic_transient" being reset, but I don't see logic relating to it in this diff. Does this already happen?
Co-authored-by: amyeroberts <[email protected]>
…transformers into fix_num_assistant_tokens
I just fixed docstring |
|
@jmamou Let's try and make the CI green :) You'll need to resolve the quality checks by running For the other failing tests, you'll need to try rebasing on main. |
|
@amyeroberts |
|
@jmamou Tbh, I'm not sure what the cause of these failures are. I would first suggest rebasing on main to make sure you have all of the most recent commits. This will trigger a re-run of the CI too. |
|
@amyeroberts |
|
@amyeroberts both CI failures seem unrelated to this PR, including |
|
@amyeroberts |
|
@jmamou Thanks for this contribution and your patience with our misbehaving CI! |
|
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. |
What does this PR do?
We have defined 2 different num_assistant_tokens_schedule values:
heuristic: When all speculative tokens are correct, increasenum_assistant_tokensby 2 else reduce by 1.num_assistant_tokensvalue is persistent over multiple generation calls with the same assistant model.heuristic_transient: Same as"heuristicbutnum_assistant_tokensis reset to its initial value after each generation call.Fixes # (issue)
#27979 (comment)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@gante @amyeroberts