-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Clean up server_args.py #7037
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
Clean up server_args.py #7037
Conversation
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.
Summary of Changes
Hello @merrymercy, 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 focuses on cleaning up and reorganizing the server arguments for improved maintainability and readability. It consolidates related arguments, removes deprecated ones, and introduces new arguments for features like CUDA graph profiling and PD disaggregation.
Highlights
- Server Argument Refactoring: Reorganized the
ServerArgs
dataclass and its corresponding CLI arguments (add_cli_args
) to group related parameters, particularly moving all Expert Parallelism (EP) arguments into a dedicated section for better clarity. - CUDA Graph Profiling: Added a new server argument
--enable-profile-cuda-graph
and implemented logic inCudaGraphRunner
to profile the CUDA graph capture process usingtorch.profiler
when this flag is enabled. - New Arguments Added: Introduced new server arguments:
--tool-call-parser
for specifying tool call handling,--debug-tensor-dump-prefill-only
for debugging,--disable-overlap-cg-plan
for disabling a specific optimization, and--num-reserved-decode-tokens
for PD disaggregation KV cache offload. - Deprecated Arguments Removed: Removed deprecated CLI arguments related to FlashInfer MLA (
--enable-flashinfer-mla
,--enable-flashmla
,--flashinfer-mla-disable-ragged
) as their functionality is now covered by the--attention-backend
argument.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configureGemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 focuses on cleaning up server_args.py
by reorganizing and grouping arguments, particularly those related to expert parallelism. This significantly enhances the readability and maintainability of the server configuration. Additionally, the PR introduces a new CUDA graph profiling capability in cuda_graph_runner.py
, along with several new server arguments for features like tool calling and multimodal attention backends. A notable correctness fix involves using .item()
to convert a tensor sum to a scalar, which is a good practice.
The changes align well with the PR's stated goals. No medium, high, or critical issues were identified in the diff. The Python code generally adheres to PEP 8 style guidelines.
expert_distribution_recorder_buffer_size: Optional[int] = None | ||
enable_expert_distribution_metrics: bool = False | ||
deepep_config: Optional[str] = None | ||
moe_dense_tp_size: Optional[int] = 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.
not sure whether this is ep-related
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.
@ch-wan 😓
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 is implemented by me #4836
I said "not sure" b/c theoretically speaking it is about how dense layers in deepseek behaves (its TP size) and is unrelated to EP, but on the other hand currently its primary usage is use with EP flags. So I personally think maybe consider it as non EP, but I am ok for whatever choice.
cadb938
to
dd6f474
Compare
Uh oh!
There was an error while loading. Please reload this page.