mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[GH-ISSUE #211] Query on performance-modeling of MoE Grouped GEMM #121
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#121
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 @sanchitintel on GitHub (Oct 9, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/211
Background
Grouped GEMMs are unlike a vanilla GEMM (a single GEMM problem in a grouped GEMM could be considered a vanilla GEMM).
If
Mis the value of M-dimension of a GEMM problem (Ais sized[M, K], andBis sized[M, N]), andB_Mis the block-level tile size's M dimension, then for a single GEMM problem, M-occupancy is computed like this:Actual number of tiles used =
(M + B_M - 1) / B_MTiles needed to fit
M=M / float(B_M)M-occupancy =
Tiles needed to fit M/Actual number of tiles usedFor a single GEMM, if
Mis large, we typically chooseB_Msuch that M-occupancy is 1, or close to 1, ifMis not a multiple ofB_M.For a Grouped GEMM, specifically the one used in MoEs, the
Mdimension of each expert may vary a lot if load-balancing is not used to route tokens to experts.As an example, we may end up with
Mdimension per expert in an MoE layer like,If we choose the same tiling scheme for all GEMM problems of a grouped GEMM, then with values as divergent as the ones above, we would have low M-occupancy if we choose
B_Msuch as256,128, which would result in a significant proportion of compute being wasteful.However, choosing a smaller
B_Mwould result in lower arithmetic intensity, which may slow down compute.Question
In your experience, if we use the same tiling scheme to compute all the GEMM problems in a grouped GEMM for MoE (without load-balancing), is the traditional roofline model still helpful in determining what the ideal latency should be? Or do you account for low
M occupancysomehow, and adjust the roofline accordingly?Thank you!
@sanchitintel commented on GitHub (Oct 9, 2025):
Will choose a more appropriate place to ask this question. Thanks!