-
Notifications
You must be signed in to change notification settings - Fork 169
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
[TextGeneration] Split up prep_for_generation
operator, handle edge cases, handle kv_cache full during prefill
#1562
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…test to cover this case, revert debugging changes
dbogunowicz
previously approved these changes
Jan 26, 2024
src/deepsparse/transformers/pipelines/text_generation/generate_new_token.py
Show resolved
Hide resolved
tests/deepsparse/transformers/pipelines/test_text_generation.py
Outdated
Show resolved
Hide resolved
dbogunowicz
approved these changes
Jan 26, 2024
bfineran
approved these changes
Jan 26, 2024
ProExpertProg
pushed a commit
that referenced
this pull request
Jan 26, 2024
… cases, handle kv_cache full during prefill (#1562) * split prep_for_generation operator * fix logits * update non-kv cache pipeline and tests * add tests to address edge cases * add condition to check of kv_cache full during prompt inference, add test to cover this case, revert debugging changes * fix typing * remove commented code * remove irrelevant condition * address PR comments
dsikka
added a commit
that referenced
this pull request
Jan 29, 2024
… cases, handle kv_cache full during prefill (#1562) * split prep_for_generation operator * fix logits * update non-kv cache pipeline and tests * add tests to address edge cases * add condition to check of kv_cache full during prompt inference, add test to cover this case, revert debugging changes * fix typing * remove commented code * remove irrelevant condition * address PR comments (cherry picked from commit 7b028d4)
bfineran
pushed a commit
that referenced
this pull request
Jan 29, 2024
… cases, handle kv_cache full during prefill (#1562) * split prep_for_generation operator * fix logits * update non-kv cache pipeline and tests * add tests to address edge cases * add condition to check of kv_cache full during prompt inference, add test to cover this case, revert debugging changes * fix typing * remove commented code * remove irrelevant condition * address PR comments (cherry picked from commit 7b028d4)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
A series of improvements:
prep_for_generation
operator such that we aren't setting up the tokenizer and generating tokens in the same operator, outside of thegeneration loop
max_length=1, max_new_tokens=0, max_new_tokens=1
. Also added the condition such thatmax_length
has to be greater than 0 or we throw aValueError
process_output
operator in theprep_for_generation
operator and can remove the custom streaming code in the operator . Also, the non-kv cache and kv_cache pipelines now both share the sameoutput_schema
, simplifying generation logicTesting