mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[GH-ISSUE #268] m_grouped_fp8_gemm_nt_masked get incorrect result when m < 64 in H20 #140
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#140
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 @alibaba-miji on GitHub (Dec 29, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/268
Environment
Question
When max_m < 64 (ie: 8,16,32), below tests assert error, but it's ok when max_m > 64.
Since readme not mention this, so I just wonder it's bug or feature?
Using below script can reproduce it.
Hoping for reply, thanks.
Script
Result
@yurekami commented on GitHub (Jan 1, 2026):
Thanks for the detailed bug report with a reproducer!
I investigated the code and found a potential root cause. In
sm90_m_grouped_fp8_gemm_masked_1d2d():The config is selected based on
expected_m(16 in your test), while TMA descriptors usem(max_m = 32):In
get_block_m_candidates(), for Kernel1D2D withm <= 16:When
expected_m = 16,block_m = 16becomes a candidate, but the actual tensor hasmax_m = 32rows. This mismatch between config selection (expected_m) and actual data dimensions (max_m) when max_m < 64 may cause alignment/boundary issues in the kernel.Potential fixes:
max_minstead ofexpected_mtoget_best_configfor masked GEMMblock_m <= max_m(not justexpected_m)max_m >= 64is required for masked GEMMThe 22.6% error suggests incorrect indexing or boundary handling when the block size exceeds or misaligns with the actual data dimensions.
I don't have a full fix yet as this requires deeper kernel-level investigation, but wanted to share these findings.
@alibaba-miji commented on GitHub (Jan 4, 2026):
Thanks for reply and explain! We temporary limit max_m >= 64 to avoid this problem, hoping to get it fixed in repo
@alibaba-miji commented on GitHub (Jan 4, 2026):
By the way, the problem still exists when
expected_m == max_m == 16 / 32, so I think the real problem may still related to max_m