Skip to content

feat: support more PD node select func #970

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

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

zhhangBian
Copy link

support more PD node select func

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @zhhangBian, 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 flexibility of PD node selection within the system. By introducing a new command-line option and refactoring the node management logic into a dedicated PDManager class, it allows operators to choose different strategies for distributing requests among available processing and decoding nodes. This change improves the system's adaptability to various deployment scenarios and resource utilization patterns.

Highlights

  • Configurable PD Node Selection: A new command-line argument --select_p_d_node_func has been added to api_cli.py, allowing users to specify the desired PD (Processing/Decoding) node selection strategy at startup. Supported options include "random", "round_robin", "memory", and "radix".
  • Refactored PD Node Management: The core logic for managing and selecting PD nodes has been extracted from HttpServerManagerForPDMaster into a new dedicated class, PDManager. This improves modularity and separation of concerns by centralizing node selection algorithms.
  • Implemented Node Selection Strategies: Initial implementations for "random" and "round_robin" PD node selection algorithms have been added within the new PDManager class, with placeholders for future "memory" and "radix" strategies.
Using Gemini Code Assist

The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and 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 to provide feedback.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 support for multiple strategies for selecting prefill and decode (PD) nodes. The changes add random and round_robin strategies, with placeholders for memory and radix. The review has identified a critical issue where the new selection strategies (random and round_robin) will crash the server if no prefill or decode nodes are available. There are also medium-severity issues related to unimplemented placeholder functions. Code suggestions have been provided to address these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants