[GH-ISSUE #112] Why topk_weights not used during combine stage except low latency version? #101

Closed
opened 2026-10-26 09:54:18 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @dearsxx0918 on GitHub (Apr 7, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/112

Hi,
I'm confused by the different combine stage behavior. In low latency version, we have this line:
github.com/deepseek-ai/DeepEP@42494864ba/csrc/kernels/internode_ll.cu (L482)

Do weights multiplies token content. But for other cases, I haven't found any weights used. Do I missed something here?

Best regards,

Originally created by @dearsxx0918 on GitHub (Apr 7, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/112 Hi, I'm confused by the different combine stage behavior. In low latency version, we have this line: https://github.com/deepseek-ai/DeepEP/blob/42494864ba64b6520337a6d084dc209ac6be4905/csrc/kernels/internode_ll.cu#L482 Do weights multiplies token content. But for other cases, I haven't found any weights used. Do I missed something here? Best regards,
Author
Owner

@LyricZhao commented on GitHub (Apr 8, 2025):

For normal kernels, the kernel requires you to multiple topk_weights before combine. As normal kernels usually do small EP like 16/32/64, a token may select more than 1 expert in a GPU, so a reduction kernel (fused with topk_weights multiplication) is required before combine to save bandwidth.

For low-latency kernels, usually 1 token will not select more than 1 expert in a GPU, so no reduction and topk_weights is used with combine.

<!-- gh-comment-id:2785358025 --> @LyricZhao commented on GitHub (Apr 8, 2025): For normal kernels, the kernel requires you to multiple `topk_weights` before `combine`. As normal kernels usually do small EP like 16/32/64, a token may select more than 1 expert in a GPU, so a reduction kernel (fused with `topk_weights` multiplication) is required before `combine` to save bandwidth. For low-latency kernels, usually 1 token will not select more than 1 expert in a GPU, so no reduction and `topk_weights` is used with `combine`.
Author
Owner

@dearsxx0918 commented on GitHub (Apr 8, 2025):

Thanks for you quickly reply!

<!-- gh-comment-id:2785425382 --> @dearsxx0918 commented on GitHub (Apr 8, 2025): Thanks for you quickly reply!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepEP#101
No description provided.