mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #492] [Feature] Per Expert Overlap (PEO) #594
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#594
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/492
Author: @k-ling3
Created: 11/13/2025
Status: 🔄 Open
Base:
main← Head:PEO📝 Commits (2)
b5fe7bbSupport per-expert-overlap SBO.ec07b5fSupport PEO combine input x size divide by num_rounds.📊 Changes
7 files changed (+374 additions, -142 deletions)
View changed files
📝
csrc/deep_ep.cpp(+93 -48)📝
csrc/deep_ep.hpp(+13 -4)📝
csrc/event.hpp(+3 -1)📝
csrc/kernels/api.cuh(+9 -2)📝
csrc/kernels/internode_ll.cu(+201 -71)📝
deep_ep/buffer.py(+8 -3)📝
tests/test_low_latency.py(+47 -13)📄 Description
Background
The insight of this work is that we group the experts, allowing the communication of some experts to overlap with the computation of other experts. We call this approach Per Expert Overlap (PEO). Compared to existing methods, our approach has the following advantages:
1. Performance:
Compared to Non-overlap, PEO performs better at all batch sizes.
Compared to PR 390 (https://github.com/deepseek-ai/DeepEP/pull/390), PEO also performs better.
2. Usability
In short, during the dispatch phase, we change the order of communication (by modifying DeepEP) to allow some experts to receive tokens first. During the GEMM phase, we change the order of computation (by modifying how the inference engine calls DeepGEMM) to allow some experts to compute first. In the combine phase, we let some experts send tokens first. Overall, this allows the communication of some experts to overlap with the computation of others.
Design
In the original DeepEP, each communication unit consists of
num_expertsornum_local_expertsexperts. That is, during the dispatch phase, each rank sends tokens tonum_expertsexperts. During the combine phase, each rank sends tokens fromnum_local_expertsexperts tonum_ranksranks.This solution modifies DeepEP by dividing the experts into
num_roundsgroups, and the communication is divided intonum_roundsrounds.num_experts // num_roundsexperts.num_local_experts // num_roundslocal experts tonum_ranksranks.The process is shown as follows:
Due to differences in model parameters, deployment scale, and batch size, this solution allows the following adjustable parameters to achieve the best overlap effect in different scenarios:
Parameters for Overlap:
Overlap method
num_rounds: Number of rounds for splitting dispatch/combine.
deepep_send_num_sms: Number of SMs used for dispatch/combine send.
deepep_recv_num_sms: Number of SMs used for dispatch/combine recv.
up_deepgemm_num_sms: Number of SMs used for UP GEMM.
down_deepgemm_num_sms: Number of SMs used for DOWN GEMM.
Performance
Configuration:
Comparison Methods:
Conclusion:
For both DPSK and QWEN, the overlap performance is the best at almost all batch sizes. For DPSK, PEO achieves a maximum of 31% improvement at batch size 128. For QWEN, PEO achieves a maximum of 50% improvement at batch size 16.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.