-
Notifications
You must be signed in to change notification settings - Fork 3.4k
router select dp group with the minimum number of tokens #13208
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @jiashaokun-1, 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 significantly enhances the router's ability to manage and distribute requests across data parallel workers. By introducing a new scheduling strategy that considers the minimum number of tokens on individual data parallel ranks, it aims to optimize resource utilization and improve the efficiency of prefill and decode operations. The changes involve extending API parameters, updating internal data structures to track per-rank loads, and modifying the core routing logic to leverage this new load information for more intelligent request distribution. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new router scheduling strategy to select a data parallel (DP) group based on the one with the minimum number of tokens. This is a significant feature for load balancing in distributed setups. The changes are extensive, correctly propagating new configuration options and logic through both the Python and Rust codebases. The introduction of a reusable DPLoadManager in Rust is a good design choice for managing DP loads. I've identified a minor bug where a statement was likely intended to be a log message, and some unreachable code that can be simplified. Overall, this is a solid and valuable contribution.
| self.workers[req.decode_dp_rank].send_pyobj(req) | ||
| return True | ||
| if req.data_parallel_rank is not None: | ||
| (f"Decode direct routing to DP rank {req.decode_dp_rank}, by data parallel rank") |
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.
This f-string is a statement with no effect and seems to be a bug. It was likely intended to be a logger.debug call. Additionally, it references req.decode_dp_rank while this code block routes based on req.data_parallel_rank, which could be confusing. I've corrected it to log req.data_parallel_rank to match the routing logic.
| (f"Decode direct routing to DP rank {req.decode_dp_rank}, by data parallel rank") | |
| logger.debug(f"Decode direct routing to DP rank {req.data_parallel_rank}, by data parallel rank") |
| if let Some(policy_registry) = &self.policy_registry { | ||
| policy_registry.enable_dp_minimum_tokens_scheduler(); | ||
| } else { | ||
| info!("policy_registry is None") | ||
| } |
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.
Motivation
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist