mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #766] [MERGED] [HybridEP] Fix the fused combine on a non-blocking dispatch #767
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#767
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/766
Author: @VesVlad
Created: 9/26/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @jershi425
Base:
hybrid-ep← Head:hybridep-fix-token-drop-in-fused-combine📝 Commits (1)
aa3122c[HybridEP] Fix the fused combine on a non-blocking dispatch📊 Changes
8 files changed (+177 additions, -5 deletions)
View changed files
📝
csrc/hybrid_ep/backend/hybrid_ep_backend.cuh(+19 -4)📝
csrc/hybrid_ep/hybrid_ep.cu(+2 -0)📝
csrc/hybrid_ep/hybrid_ep.cuh(+1 -0)📝
csrc/hybrid_ep/pybind_hybrid_ep.cu(+1 -0)📝
deep_ep/hybrid_ep_buffer.py(+2 -0)📝
docs/Hybrid-EP_Implementation.md(+2 -1)📝
tests/test_graphed_hybrid_ep.py(+2 -0)➕
tests/test_hybrid_ep_token_drop.py(+148 -0)📄 Description
A non-blocking dispatch drops the tokens that overflow its fixed capacity. The fused combine hangs on them, and once it stops hanging it returns NaN.
Why
The scan kernel clamps a dropped token's entries in dense_to_expert_map to -1, which leaves dst tokens with no src token at all. Two things break:
HYBRID_EP_BUILD_TOKEN_DROP_ENABLE, which is set whenfuse_unpermute_combine && non_blocking. Butcombine_with_unpermutenever took anon_blockingargument, so the combine was always built without it: the producer pushes nothing, the consumer waits for the end-of-group flag forever.What changed
non_blockingplumbed throughcombine_with_unpermute, mirroringdispatch_with_permute, and assigned toargs.non_blocking.BACKWARD_COMBINE– with a__threadfence_block()before the mbarrier arrive.A fully dropped dst token now contributes zero, which is what the standalone unpermute path in extension/permute.cu already did.
Testing
tests/test_hybrid_ep_token_drop.py(new): top-1 routing at half the capacity a balanced dispatch needs, so tokens really are dropped. Asserts the overflow flag fires, the run does not hang, surviving tokens return bitwise unchanged and fully dropped ones return zeroed.tests/test_graphed_hybrid_ep.pynow passesnon_blocking=Trueto the combine, matching its dispatch.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.