Skip to content

[DSV4] Fuse norm and router for low latency scenario - #41263

Merged
vllm-bot merged 12 commits into
mainfrom
fused-norm-gate-dsv4
May 14, 2026
Merged

[DSV4] Fuse norm and router for low latency scenario#41263
vllm-bot merged 12 commits into
mainfrom
fused-norm-gate-dsv4

Conversation

@jeejeelee

@jeejeelee jeejeelee commented Apr 29, 2026

Copy link
Copy Markdown
Member

Purpose

Test Plan

performance

  • DSV4PRO TP8 on B300
Conc Req/s Tok/s Total tok/s P50 TTFT (ms) P50 TPOT (ms)
1 0.05 / 0.05 79.59 / 81.24 610.22 / 622.87 464.78 / 465.56 12.27 / 12.01
2 0.10 / 0.10 149.32 / 153.65 1144.79 / 1177.97 744.53 / 739.69 12.89 / 12.52
4 0.17 / 0.18 264.94 / 270.77 2031.17 / 2075.87 1058.05 / 1052.65 14.42 / 14.09
8 0.29 / 0.29 444.52 / 448.46 3407.96 / 3438.20 1182.50 / 1175.03 17.07 / 16.98
16 0.44 / 0.44 681.00 / 677.57 5220.99 / 5194.73 1238.56 / 1179.68 22.39 / 22.65
32 0.61 / 0.61 933.24 / 935.77 7154.81 / 7174.21 1242.79 / 1234.85 33.07 / 33.08

Accuracy

  • DSV4PRO TP8 on B300
Dataset ACC
GSM8K flexible-extract=0.9484 /strict-match=0.9492
AIME25 exact_match=0.9833
GPQA-D exact_match=0.8952

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@jeejeelee
jeejeelee marked this pull request as draft April 29, 2026 17:37
@mergify mergify Bot added ci/build deepseek Related to DeepSeek models performance Performance-related issues labels Apr 29, 2026

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

Copy link
Copy Markdown
Contributor

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 implements a fused RMSNorm and router GEMV kernel specifically optimized for DeepSeek V4 (DSV4-Pro) to reduce kernel launch overhead. The changes include the CUDA kernel implementation, a new NormGatedLinear layer for runtime dispatching between fused and unfused paths, and updates to the DeepSeek V4 model to utilize this optimization. A benchmark script is also provided for performance and correctness verification. Feedback was provided regarding the SM version check in the kernel entry point, which may be overly restrictive for future architectures supported by the build configuration.

Comment on lines +112 to +113
TORCH_CHECK(sm >= 90 && sm <= 103,
"dsv4_norm_router_gemm requires SM_90 <= CUDA ARCH <= SM_103");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The runtime check restricts the kernel to SM versions up to 103. However, CMakeLists.txt allows building for SM 11.0 and 12.0 (if CUDA 13.0 is used). If the kernel is compiled for these future architectures, it will fail at runtime despite being SM90+ compatible. Consider relaxing the upper bound if the kernel is expected to be forward-compatible.

@jeejeelee jeejeelee mentioned this pull request Apr 30, 2026
32 tasks
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
@jeejeelee
jeejeelee marked this pull request as ready for review May 13, 2026 14:45

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@zyongye zyongye added the ready ONLY add when PR is ready to merge/full CI is needed label May 14, 2026
@vllm-bot
vllm-bot merged commit 0a65d46 into main May 14, 2026
162 of 164 checks passed
@vllm-bot
vllm-bot deleted the fused-norm-gate-dsv4 branch May 14, 2026 12:11
mfylcek pushed a commit to mfylcek/vllm that referenced this pull request May 19, 2026
)

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: jeejeelee <jeejeelee@verda-b300-05.datacrunch.io>
Co-authored-by: jeejeelee <jeejeelee@verda-b300-05.datacrunch.io>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
h1t35h pushed a commit to h1t35h/vllm that referenced this pull request May 21, 2026
)

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: jeejeelee <jeejeelee@verda-b300-05.datacrunch.io>
Co-authored-by: jeejeelee <jeejeelee@verda-b300-05.datacrunch.io>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Liuweixiong0118 pushed a commit to Liuweixiong0118/vllm that referenced this pull request Jun 1, 2026
)

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: jeejeelee <jeejeelee@verda-b300-05.datacrunch.io>
Co-authored-by: jeejeelee <jeejeelee@verda-b300-05.datacrunch.io>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Signed-off-by: Liuweixiong0118 <lwx34158427@gmail.com>
philippesic pushed a commit to philippesic/vllm-semantic-cache that referenced this pull request Jul 19, 2026
)

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Signed-off-by: jeejeelee <jeejeelee@verda-b300-05.datacrunch.io>
Co-authored-by: jeejeelee <jeejeelee@verda-b300-05.datacrunch.io>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build deepseek Related to DeepSeek models performance Performance-related issues ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants