-
Notifications
You must be signed in to change notification settings - Fork 62
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
Tgi correct clear implementation #609
Merged
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
dacorvo
force-pushed
the
tgi_correct_clear_implementation
branch
from
May 27, 2024 07:15
fcce2f8
to
0e32b71
Compare
When all requests from a prefill batch are cancelled, the router will not send a filter request, but rather a clear cache request with the batch_id. We previously ignored that value and cleared everything.
dacorvo
force-pushed
the
tgi_correct_clear_implementation
branch
from
May 27, 2024 08:12
0e32b71
to
58eafcb
Compare
JingyaHuang
approved these changes
May 27, 2024
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.
LGTM, thanks for the fix!
tengomucho
added a commit
to huggingface/optimum-tpu
that referenced
this pull request
Jul 1, 2024
This clears a potential issue when clearing TGI requests. When a client cancels a TGI request, two different methods can be called on the TGI server: - if the request is cancelled after prefill, then the router asks the server to "filter" the decoding batch from the corresponding request. This is correctly implemented, - if the request is cancelled during prefill, then the router asks the server to clear the whole prefill batch. This was not correctly implemented because in that configuration we cleared all requests, even those not included in that prefill batch. This is now fixed, basically reproducing TGI Neuron fix: huggingface/optimum-neuron#609
tengomucho
added a commit
to huggingface/optimum-tpu
that referenced
this pull request
Jul 1, 2024
This clears a potential issue when clearing TGI requests. When a client cancels a TGI request, two different methods can be called on the TGI server: - if the request is cancelled after prefill, then the router asks the server to "filter" the decoding batch from the corresponding request. This is correctly implemented, - if the request is cancelled during prefill, then the router asks the server to clear the whole prefill batch. This was not correctly implemented because in that configuration we cleared all requests, even those not included in that prefill batch. This is now fixed, basically reproducing TGI Neuron fix: huggingface/optimum-neuron#609
tengomucho
added a commit
to huggingface/optimum-tpu
that referenced
this pull request
Jul 2, 2024
This clears a potential issue when clearing TGI requests. When a client cancels a TGI request, two different methods can be called on the TGI server: - if the request is cancelled after prefill, then the router asks the server to "filter" the decoding batch from the corresponding request. This is correctly implemented, - if the request is cancelled during prefill, then the router asks the server to clear the whole prefill batch. This was not correctly implemented because in that configuration we cleared all requests, even those not included in that prefill batch. This is now fixed, basically reproducing TGI Neuron fix: huggingface/optimum-neuron#609
tengomucho
added a commit
to huggingface/optimum-tpu
that referenced
this pull request
Jul 2, 2024
This clears a potential issue when clearing TGI requests. When a client cancels a TGI request, two different methods can be called on the TGI server: - if the request is cancelled after prefill, then the router asks the server to "filter" the decoding batch from the corresponding request. This is correctly implemented, - if the request is cancelled during prefill, then the router asks the server to clear the whole prefill batch. This was not correctly implemented because in that configuration we cleared all requests, even those not included in that prefill batch. This is now fixed, basically reproducing TGI Neuron fix: huggingface/optimum-neuron#609
tengomucho
added a commit
to huggingface/optimum-tpu
that referenced
this pull request
Jul 3, 2024
* fix(tgi): remove all the variables from entrypoint.sh * fix(tgi): correct version * fix(tgi): pin numpy version <2.0 * feat(tgi): entrypoint adds GKE specific command * fix(generator): correct CachedBatch serialization when it's None This was generating a tricky error when calling "/health" at the server startup: this was calling prefill and returning None as the cached batch, that was failing to be serialized. * feat(generator): prefill input preparation is done on CPU Doing that on TPU seems to slow down (due to compilation?) and takes a lot of memory. * feat(generator): decode input preparation is done on CPU * feat(generator): support TGI truncate parameter in Request * fix(generator): warmup clears after prefill This allows to correctly handle warmup. * fix(tgi): correct clear implementation This clears a potential issue when clearing TGI requests. When a client cancels a TGI request, two different methods can be called on the TGI server: - if the request is cancelled after prefill, then the router asks the server to "filter" the decoding batch from the corresponding request. This is correctly implemented, - if the request is cancelled during prefill, then the router asks the server to clear the whole prefill batch. This was not correctly implemented because in that configuration we cleared all requests, even those not included in that prefill batch. This is now fixed, basically reproducing TGI Neuron fix: huggingface/optimum-neuron#609 * feat(ci): release TGI images only when release is published * chore(generator): turn log info -> debug on clear --------- Co-authored-by: Morgan Funtowicz <funtowiczmo@gmail.com>
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.
What does this PR do?
This pull-request fixes an issue when clearing TGI requests.
When a client cancels a TGI request, two different methods can be called on the TGI server:
We now remember to which prefill batch each request belongs to be able to clear only the relevant requests.
Note that this pull-request also fixes a bug with models deployed on TGI that do not support continuous batching (i.e. gpt2 and older models).