-
Notifications
You must be signed in to change notification settings - Fork 20
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
perf: Check for cancellation on response thread #54
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
20 tasks
oandreeva-nv
reviewed
Aug 1, 2024
oandreeva-nv
previously approved these changes
Aug 1, 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! Please, let @Tabrizian to look at it as well
Tabrizian
previously approved these changes
Aug 6, 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.
One minor comment, otherwise looks good.
Co-authored-by: Iman Tabrizian <[email protected]>
This was referenced Aug 6, 2024
…d into jacky-cancel-thread
Tabrizian
approved these changes
Aug 7, 2024
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 the PR do?
Cancellation check is to be performed during the response loop on the response thread. The status of the cancellation will be written back a object shared between the response loop and generate loop on a particular request. After sending a response, the cancellation status will be checked and the generate loop will cancel the generation if the request is cancelled. Combined with the release of GIL while checking for cancellation, this maximizes the vLLM generation time on the GIL, which has seen noticeable performance improvement.
Checklist
<commit_type>: <Title>
Commit Type:
Check the conventional commit type
box here and add the label to the github PR.
Related PRs:
triton-inference-server/python_backend#372
Where should the reviewer start?
Start at once a cancellation is issued while responses are being actively generated, does the generate loop capture the cancellation signal? Is the final flag sent (both streaming/non-streaming) after cancelling? Is the response sender deleted and garbage collected after cancelling?
Test plan:
This is a performance improvement, so any issue should be covered by existing test cases.
Caveats:
N/A
Background
Need to improve the performance on vLLM backend.
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
N/A