Skip to content

Conversation

@Fridge003
Copy link
Collaborator

Motivation

Modifications

Accuracy Tests

Benchmarking and Profiling

Checklist

@github-actions github-actions bot added documentation Improvements or additions to documentation deepseek labels Dec 6, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Fridge003, 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 introduces new environment variables to provide more granular control over Deep Expert Parallelism (DeepEP) configurations and quantization settings, particularly for NVFP4 and FP8 operations. It also refactors the codebase to centralize environment variable access through a dedicated envs object, improving consistency and maintainability. These changes aim to enhance performance tuning and support for advanced quantization techniques within the SGLang framework.

Highlights

  • New Environment Variables: Introduced several new environment variables to fine-tune DeepEP and quantization settings, including SGLANG_DEEPEP_NUM_MAX_DISPATCH_TOKENS_PER_RANK, SGLANG_DEEPEP_LL_COMBINE_SEND_NUM_SMS, SGLANG_NVFP4_CKPT_FP8_GEMM_IN_ATTN, and SGLANG_PER_TOKEN_GROUP_QUANT_8BIT_V2.
  • Environment Variable Refactoring: Centralized the access of environment variables by refactoring code to use the envs object (e.g., envs.VAR_NAME.get()) instead of direct utility functions like get_int_env_var or get_bool_env_var, improving consistency and maintainability.
  • Documentation Update: The environment_variables.md documentation was updated to reflect the newly added environment variables and provide a more detailed description for SGLANG_MOE_NVFP4_DISPATCH.
  • DeepEP Configuration Enhancements: Enhanced configuration options for DeepEP, particularly for managing dispatched tokens per rank and the number of Streaming Multiprocessors (SMs) used for combining operations, with specific adjustments for Blackwell and Hopper architectures.
  • Quantization Control: Added granular control over quantization, including an option to quantize q_b_proj from BF16 to FP8 for DeepSeek NVFP4 checkpoints and to apply a per-token group quantization kernel.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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

  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.

@Fridge003
Copy link
Collaborator Author

Mostly related to wideep
cc @ishandhanani

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 introduces new environment variables for dpsk-fp4 and DeepEP, and refactors existing code to use a centralized environment variable management system. The changes are generally well-structured. However, I've identified a few issues, including a logic flaw in setting a default value which could override user settings, a potential bug due to swapped function arguments, and some minor formatting and typo issues in both code and documentation. I've provided specific suggestions for each of these points to improve correctness and maintainability.

Fridge003 and others added 5 commits December 6, 2025 01:27
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Fridge003
Copy link
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions bot added the run-ci label Dec 6, 2025
@Fridge003 Fridge003 merged commit 9dfa01a into main Dec 6, 2025
264 of 280 checks passed
@Fridge003 Fridge003 deleted the baizhou/envs branch December 6, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek documentation Improvements or additions to documentation run-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants