Skip to content

Accelerate deepseek fp4 b200 ci#11993

Merged
Kangyan-Zhou merged 7 commits intosgl-project:mainfrom
Qiaolin-Yu:b200_ci
Oct 25, 2025
Merged

Accelerate deepseek fp4 b200 ci#11993
Kangyan-Zhou merged 7 commits intosgl-project:mainfrom
Qiaolin-Yu:b200_ci

Conversation

@Qiaolin-Yu
Copy link
Collaborator

@Qiaolin-Yu Qiaolin-Yu commented Oct 23, 2025

Motivation

It's based on #11821 . Will rebase after that pr is merged.

image It takes 386s on my local server. I think it's time to add this back.

Modifications

Accuracy Tests

Benchmarking and Profiling

Checklist

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Qiaolin-Yu, 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 re-integrates the DeepSeek FP4 B200 CI test, which was previously disabled, into the continuous integration pipeline. The re-enabling is motivated by successful local testing, demonstrating a reasonable execution time. Alongside this, the PR introduces performance enhancements by caching Triton kernels and updates the draft extension logic to support a newer version. It also configures the KV cache to use fp8_e4m3 and enables a beta specification within the DeepSeek FP4 tests, ensuring the test environment accurately reflects optimized configurations for the model.

Highlights

  • Re-enabled CI Test: The test_deepseek_v3_fp4_4gpu.py test for the DeepSeek FP4 model on B200 GPUs has been re-enabled in the per-commit-4-gpu-b200 CI suite, indicating its readiness for integration.
  • Triton Kernel Caching: Implemented caching for Triton JIT kernels (pad_draft_extend_query_kernel and unpad_draft_extend_output_kernel) to optimize performance by avoiding recompilation of frequently used kernels.
  • Draft Extension Logic Update: Modified the is_draft_extend checks across the attention mechanism to include include_v2=True, suggesting support for an updated or new version of the draft extension feature.
  • KV Cache Configuration: Explicitly configured the KV cache data type to fp8_e4m3 and enabled beta-spec for the DeepSeek FP4 tests, likely for improved efficiency, memory usage, or compatibility with specific hardware features.
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.

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 re-enables the CI test for deepseek-v3 fp4 on b200 GPUs. The changes include updating the test suite configuration and modifying the trtllm_mla_backend to support a new speculative decoding mode (DRAFT_EXTEND_V2). The logic seems correct and the changes are consistent with the goal of the PR. I have one suggestion to improve code clarity in the attention backend.

Comment on lines 528 to 532
if (
forward_batch.forward_mode.is_extend()
and not forward_batch.forward_mode.is_target_verify()
and not forward_batch.forward_mode.is_draft_extend()
and not forward_batch.forward_mode.is_draft_extend(include_v2=True)
):
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The condition here is intended to check if the forward mode is EXTEND or MIXED. The current implementation is a bit complex and the change in this PR is redundant as it does not alter the logical outcome. For better readability and maintainability, I suggest simplifying this condition to directly check for these two modes.

        mode = forward_batch.forward_mode
        if mode == ForwardMode.EXTEND or mode == ForwardMode.MIXED:

@Qiaolin-Yu Qiaolin-Yu changed the title Add deepseek fp4 b200 ci back Accelerate deepseek fp4 b200 ci Oct 25, 2025
@Kangyan-Zhou Kangyan-Zhou merged commit d98b81e into sgl-project:main Oct 25, 2025
67 of 69 checks passed
@Qiaolin-Yu Qiaolin-Yu deleted the b200_ci branch October 25, 2025 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments