mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #390] [CLOSED] [Feat] Single Batch Overlap (SBO): Overlaping of Down GEMM with Combine Send #546
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepEP#546
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepEP/pull/390
Author: @Zqy11
Created: 9/2/2025
Status: ❌ Closed
Base:
main← Head:feat/overlap📝 Commits (10+)
9a58e8cfeat: Overlap down gemm and combine send433a6a4merge main42ed271optimize put finishing flag for overlap mode389e94boptimize put finishing flag for overlap modeb596396Merge branch 'main' of https://github.com/Zqy11/DeepEP into feat/overlap988bad8maintain: delete redundant code11c5c66maintain: add lambda send_finish_flag99378d5maintain: merge main6601898Merge branch 'main' of github.com:Zqy11/DeepEP into feat/overlapb6f500cmaintain: add kNumMaxExperts📊 Changes
7 files changed (+218 additions, -67 deletions)
View changed files
📝
csrc/deep_ep.cpp(+16 -5)📝
csrc/deep_ep.hpp(+2 -0)📝
csrc/kernels/api.cuh(+4 -3)📝
csrc/kernels/internode_ll.cu(+135 -31)📝
deep_ep/buffer.py(+16 -2)📝
tests/test_low_latency.py(+41 -26)📝
tests/utils.py(+4 -0)📄 Description
1. Motivation
The optimization effect of Two-Batch Overlap (TBO) is suboptimal for the Decode phase on low-compute-power cards (i.e., H20). This is due to two main factors: First, on the Hopper architecture, the WGMMA block_m is 64. Consequently, when TBO is enabled with a small Decode batch size, the MLP GEMM suffers from redundant computations. A positive throughput gain is only observed at larger batch sizes (e.g., 64, 128). Second, at these larger batch sizes, low-compute-power cards like the H20 fail to meet the SLA guarantees for TPOT/ITL.
Therefore, it is necessary to find a solution that can improve Decode throughput even with small batch sizes. Single Batch Overlap (SBO) presents itself as a viable solution.
We implement SBO for DeepSeek v3/R1 by modifying DeepEP and DeepGEMM, including the overlap of Shared Expert and Dispatch Recv, as well as the overlap of Down GEMM with Combine Send.
The overlap of Down GEMM with Combine Send is implemented by modifying SGlang, DeepEP and DeepGEMM, with the detailed implementation available in the PRs below:
We also conduct integration and evaluation in SGLang: https://github.com/sgl-project/sglang/pull/9660.
2. Overlap Design
SBO implements two overlap for the MoE layers of DeepSeek-V3/R1. One is to overlap the Shared Expert computation with the Dispatch Recv communication, and the other is to overlap the Down GEMM computation with the Combine Send communication.


The interaction between Down GEMM and Combine Send is structured as a producer-consumer model synchronized by signals. For each local expert, a signal unit is allocated for every block_m tokens. The Down GEMM computes the results for these block_m tokens and atomically increments the signaling unit after completing a portion of the work. The Combine Send polls this signaling unit. Once the value reaches a threshold, it sends the corresponding block_m tokens.
3. Modifications
low_latency_dispatch, change the type of packed_recv_src_info from kInt32 to kInt64 to track the src_rank for each token.internode_ll::combinekernel uses fewer SMs when theoverlapparameter is enabled and integrates logic for overlap mode, such as polling signals, sending tokens and puting finish flag.4. Evaluation
We integrated the modified DeepEP and DeepGEMM into SGLang for performance evaluation.
4.1. Experiment Setup
4.2. Performance Evaluation
4.3. Accuracy Tests
4.4. Repro Script
Please refer to https://github.com/sgl-project/sglang/pull/9660.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.