Fix wrong running_bs in priority scheduling#13142
Conversation
I receive following logs when running test_priority_scheduling_with_multiple_running_requests_preemption. Prefill batch, #new-seq: 1, #new-token: 30, #cached-token: 0, token usage: 0.00, #running-req: -1, #queue-req: 2, running_batch has been filtered in preempt_to_schedule(). No need to subtract preempt_list again. Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com>
Summary of ChangesHello @dtcccc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug in the priority scheduling mechanism where the count of active requests ( Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a bug in the priority scheduling logic. The original code was incorrectly calculating the running batch size after preemption by subtracting the number of preempted requests from an already-updated running batch, which led to double-counting. The change ensures the running batch size is calculated correctly by simply using the length of the running_batch.reqs, which is already filtered. This is a good and necessary fix.
There was a problem hiding this comment.
Looks reasonable to me. It should never be a negative value. cc: @hnyls2002
|
LGTM! Thank you! |
I receive following logs when running
test_priority_scheduling_with_multiple_running_requests_preemption.
running_batch has been filtered in preempt_to_schedule(). No need to subtract preempt_list again.
Motivation
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist