mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[GH-ISSUE #160] v2 seems to be slower than v1 on hopper on some cases #92
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#92
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 @fzyzcjy on GitHub (Aug 14, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/160
related: https://github.com/sgl-project/sglang/pull/9167
I briefly look at profile, and see some deepgemm kernels have slower speed. before digging deeper, I create an issue to report to know e.g. is it on the roadmap and is not yet optimized.
speed:
baseline:
1755163919.4467359-TP-6.trace.json.gz
pr:
1755161669.4129217-TP-6.trace.json.gz
example screenshot (for a stable-shape gemm. the most time-consuming gemm is moe, but that changes a lot since expert is imbalanced, so I do not screenshot here)
baseline:
pr:
@fzyzcjy commented on GitHub (Aug 15, 2025):
Made a docker-based sample that I test on both H200 and H100 as follows. I think probably some of my env has something wrong, especially given the H100 v2 is so slow...
H200, v1
H200, v2
H100, v1
H100, v2
@coconut902 commented on GitHub (Aug 18, 2025):
This might be the reason. Try NVCC 12.9?
@fzyzcjy commented on GitHub (Aug 18, 2025):
The docker image is:
nvidia/cuda:12.9.0-cudnn-devel-ubuntu22.04thus I think it seems to be 12.9.The host driver is a bit old though, and I am wondering whether that may be the case or not... (do not have time to check it yet)
@coconut902 commented on GitHub (Aug 19, 2025):
But your v1 log shows you were using
NVRTC version: (12, 8)...@fzyzcjy commented on GitHub (Aug 19, 2025):
Yes I am also confused... nvcc is new though. indeed if nvcc is old, deepgemm will provide an warning message.
@coconut902 commented on GitHub (Aug 19, 2025):
You can update your nvrtc like:
@fzyzcjy commented on GitHub (Aug 19, 2025):
Good point. (but it seems v2 does not use nvrtc)
@coconut902 commented on GitHub (Aug 19, 2025):
Recent PRs have supported NVRTC. README is outdated.
@fzyzcjy commented on GitHub (Aug 19, 2025):
looks reasonable, I will upgrade and try again
@fzyzcjy commented on GitHub (Aug 20, 2025):
@zhonghui-J
Commands
Results
@fzyzcjy commented on GitHub (Aug 20, 2025):
@zhonghui-J btw, can you reproduce the correct performance using v2 code on your machines? If so, could you please try my docker reproduction above to see whether it is slow on your machine, and/or show your envs. Thanks!
EDIT: or could you please provide reproduction steps to your fast performance scenario
@coconut902 commented on GitHub (Aug 20, 2025):
@fzyzcjy I just reproduced the bad performance.
And I found it's mainly caused by
get_num_1d_blocks_per_group()indeep_gemm/include/deep_gemm/common/scheduler.cuh.After I commented some lines like the following, the performance gets better.
On my H800,
before:
after:
@RayWang96 Could you please tell us what's the point of
For grouped GEMMs, let weights always stay in the L2 cache and read activations by once?@fzyzcjy commented on GitHub (Aug 20, 2025):
Interesting, DeepSeek said they could reproduce the good performance on hopper using latest main (i.e. I think without code changes). iirc in their blog they say also use H800
@coconut902 commented on GitHub (Aug 20, 2025):
Did you mean commit
f85ec649d7(0815)?Performance of commit
3254b758e2(0814) is still good, though slightly worse than v1. But commitf85ec649d7(0815) is much worse.@fzyzcjy commented on GitHub (Aug 20, 2025):
Yes I test via latest commit. Let me test 0814 commit later.
@fzyzcjy commented on GitHub (Aug 20, 2025):
By changing my reproduction above to 0814 commit
The speed is better now, though it is still worse than v1.
@coconut902 commented on GitHub (Aug 20, 2025):
The bad performance of 0814 commit is due to non-optimal configs, issue #161
On my H800,
before fixing issue #161
after:
0815 commit fixed the issue, but introduced a new problem.
@fzyzcjy commented on GitHub (Aug 20, 2025):
I see, looks pretty reasonable. Maybe I will wait a bit to see whether this will be fixed soon. cc @LyricZhao