-
Notifications
You must be signed in to change notification settings - Fork 267
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
Gateway plugin report total incoming requests and pending requests #554
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
…meta_total_reqs" and "meta_pending_reqs". Currently, no request membership is implemented for "meta_pending_reqs" Improve lock efficiency
varungup90
reviewed
Jan 9, 2025
varungup90
reviewed
Jan 9, 2025
varungup90
reviewed
Jan 9, 2025
varungup90
reviewed
Jan 9, 2025
varungup90
reviewed
Jan 9, 2025
varungup90
reviewed
Jan 9, 2025
varungup90
reviewed
Jan 9, 2025
varungup90
reviewed
Jan 9, 2025
varungup90
reviewed
Jan 9, 2025
varungup90
reviewed
Jan 9, 2025
After request returns, request counter now decrease in header phase. Added benchmark for new approach.
Jeffwan
reviewed
Jan 11, 2025
A request will be counted as completed until all tokens are read, including stream mode.
{\"object\":\"error\",\"message\":\"....\",\"type\":\"BadRequestError\",\"param\":null,\"code\":400}"
varungup90
reviewed
Jan 16, 2025
varungup90
reviewed
Jan 17, 2025
varungup90
reviewed
Jan 17, 2025
varungup90
reviewed
Jan 17, 2025
varungup90
reviewed
Jan 17, 2025
varungup90
approved these changes
Jan 21, 2025
Looks like Varun already approved the change, let's merge this PR. |
Jeffwan
approved these changes
Jan 21, 2025
gangmuk
pushed a commit
that referenced
this pull request
Jan 25, 2025
) * Upgrade request trace version to 3 that include two more meta info: "meta_total_reqs" and "meta_pending_reqs". Currently, no request membership is implemented for "meta_pending_reqs" Improve lock efficiency * Bug fix: remove deadlocking. * bug fix * Improve error logs * Improve comments * Pending requests now count total pending only. After request returns, request counter now decrease in header phase. Added benchmark for new approach. * Refine pendingRequests by replace with completionRequests. A request will be counted as completed until all tokens are read, including stream mode. * Usage now can correctly handle unknown response, such as: {\"object\":\"error\",\"message\":\"....\",\"type\":\"BadRequestError\",\"param\":null,\"code\":400}" * Bug fix, open_ai is IsKnown() function is not applicable in our vLLM * Update document * Fix file names and bug fix * Lint fix * Update tests * Update tests * Temporarily disable a test for further investigation. * Bug fix * Rewrite the test to make it more accurate. * Respond to review comments. --------- Signed-off-by: Jingyuan <[email protected]> Co-authored-by: Jingyuan Zhang <[email protected]>
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.
Pull Request Description
While meta_pending_reqs ideally equals pending requests out of the current report window, which is:
The counting of counting requests in the current report window (current pending requests) relies on some kind of request membership in the new created RequestTrace struct, either using term-based or requestID-based. Currently, no request membership is implemented for "current pending requests," so "meta_pending_reqs" is practically smaller than defined.
Improve lock efficiency by (1) Creating a new RequestTrace struct for trace level locking. (2) Minimizing the cache level locking block. (3) Adding test cases to ensure reporting accuracy (no request missing) during trace window transition.
Align the trace report time to the report interval with a max offset of 500ms. Previously, trace reports of tick 30s can be written to the Redis during [30s, 40s) depending on when the gateway plugin starts. This PR fixed this indeterministicity by waiting a short period at the gateway plugin starting. Now, reports will be written to Redis at tick (30s, 30.5s].
Resolved a deadlock problem by calling locked debuginfo() in other locked functions().
Fixed a bug that the gateway plugin can't handle error responses from the vllm and responded with a misunderstanding message.
Related Issues
Resolves: #[Insert issue number(s)]
Important: Before submitting, please complete the description above and review the checklist below.
Contribution Guidelines (Expand for Details)
We appreciate your contribution to aibrix! To ensure a smooth review process and maintain high code quality, please adhere to the following guidelines:
Pull Request Title Format
Your PR title should start with one of these prefixes to indicate the nature of the change:
[Bug]
: Corrections to existing functionality[CI]
: Changes to build process or CI pipeline[Docs]
: Updates or additions to documentation[API]
: Modifications to aibrix's API or interface[CLI]
: Changes or additions to the Command Line Interface[Misc]
: For changes not covered above (use sparingly)Note: For changes spanning multiple categories, use multiple prefixes in order of importance.
Submission Checklist
By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.