Skip to content

Conversation

merrymercy
Copy link
Contributor

@merrymercy merrymercy commented Jun 10, 2025

  • Move all EP related things into a single group
  • Sort them correctly

@merrymercy merrymercy changed the title Cleanup server args Clean up server_args.py Jun 10, 2025
Copy link
Contributor

@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 @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 in CudaGraphRunner to profile the CUDA graph capture process using torch.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

  1. 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.

Copy link
Contributor

@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 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
Copy link
Collaborator

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

Copy link
Member

Choose a reason for hiding this comment

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

@ch-wan 😓

Copy link
Collaborator

@fzyzcjy fzyzcjy Jun 10, 2025

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.

@merrymercy merrymercy force-pushed the lianmin/minor-fix-cuda-graph-profiling branch from cadb938 to dd6f474 Compare June 10, 2025 11:25
@merrymercy merrymercy merged commit 6406408 into main Jun 10, 2025
1 of 47 checks passed
@merrymercy merrymercy deleted the lianmin/minor-fix-cuda-graph-profiling branch June 10, 2025 12:34
almaslof pushed a commit to mpashkovskii/sglang that referenced this pull request Jun 11, 2025
jianan-gu pushed a commit to jianan-gu/sglang that referenced this pull request Jun 12, 2025
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.

4 participants