mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[GH-ISSUE #20] How to skip certain expert in grouped gemm masked layout #16
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/DeepGEMM#16
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?
Originally created by @DiegoD94 on GitHub (Feb 27, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/20
Hi, thanks for the great implementation.
I'm trying to use this grouped gemm kernel into FusedMoE. I tried to set the mask_m as 0 for the experts that I want to skip but it got me nan for the output. Wondering is there a best practice for skipping certain experts? Which should be a very common situation under low batch size decoding stage.
@LyricZhao commented on GitHub (Feb 27, 2025):
The current impl already supports that, try this test (notice
masked_m[1] = 0 # !!!! Skipping the expert 1in the test):For the skipped experts, the NaN output is in expectation as no computation for that expert and no memory writes (no cleaning them into zero).
@DiegoD94 commented on GitHub (Feb 27, 2025):
Ahh thanks for your reply! That makes sense, got asserted for the nan diff at the beginning, but yeah that should be the expected behavior, closing this for now :)
@DiegoD94 commented on GitHub (Feb 27, 2025):
Sry for re-opening this issue, but I observed an unexpected benchmark result.
I was trying to benchmark low batch size decoding situation, where assume batch size = 8, then it should be at most 64 experts get routed, and the rest should be skipped.
I'm setting the group number as 256 for TP situation and 32 for EP situation, then I tried to skip certain experts by setting the masking, however I found that the latency won't reduce much even with a lot mask m = 0, could i be that I have some mis understanding of using the kernel?
Below is my latency benchmark and also my test code. All tested on H200 GPU though.:
@zheanxu commented on GitHub (Feb 27, 2025):
@DiegoD94 It seems that
real_mis not set correctly intest_func.