[GH-ISSUE #125] [Question] Do you have any plans to improve grouped wgrad gemm? #74

Open
opened 2026-10-26 21:11:56 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @shcho1118 on GitHub (Jul 9, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/125

First of all, thank you for sharing your great implementation.
We are experimenting with using some non-gemm kernels (e.g. quantize, transpose, permute, 128-align per group) with DeepGEMM to train our moe models.
In practice, we observed significant speedups over TransformerEngine GroupedLinear for fprop and dgrad, but negligible performance gains for wgrad.
It seems that there is something that can be optimized, since it launches a non-grouped version of wgrad for each group separately.
TransformerEngine has a similar implementation, but at least it utilizes multi-stream.
Do you have any plans or hints to improve these?

Originally created by @shcho1118 on GitHub (Jul 9, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/125 First of all, thank you for sharing your great implementation. We are experimenting with using some non-gemm kernels (e.g. quantize, transpose, permute, 128-align per group) with DeepGEMM to train our moe models. In practice, we observed significant speedups over [TransformerEngine GroupedLinear](https://docs.nvidia.com/deeplearning/transformer-engine/user-guide/api/pytorch.html#transformer_engine.pytorch.GroupedLinear) for fprop and dgrad, but negligible performance gains for wgrad. It seems that there is something that can be optimized, since it launches a non-grouped version of wgrad for each group separately. TransformerEngine has a similar implementation, but at least it utilizes [multi-stream](https://github.com/NVIDIA/TransformerEngine/blob/f05f12c974b37c5bd8dfca3d2d294be53b66abfa/transformer_engine/common/gemm/cublaslt_gemm.cu#L629). Do you have any plans or hints to improve these?
Author
Owner

@LyricZhao commented on GitHub (Jul 21, 2025):

Sorry for my late reply.

2 weeks ago, the wgrad kernel utilizes 2 streams. And we believe the performance is good enough (memory bound) and has similar perf with cuBLAS.

For now, we currently remove the SM90 impl on the latest commit (but we have a fast impl for SM100 by NVIDIA). Later, @zheanxu will follow this up and push a single-stream single-kernel (even for grouped GEMMs) SM90 impl for wgrad.

<!-- gh-comment-id:3095001235 --> @LyricZhao commented on GitHub (Jul 21, 2025): Sorry for my late reply. 2 weeks ago, the wgrad kernel utilizes 2 streams. And we believe the performance is good enough (memory bound) and has similar perf with cuBLAS. For now, we currently remove the SM90 impl on the latest commit (but we have a fast impl for SM100 by NVIDIA). Later, @zheanxu will follow this up and push a single-stream single-kernel (even for grouped GEMMs) SM90 impl for wgrad.
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/DeepGEMM#74
No description provided.