mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #475] Fix SM120 split-K alignment after partition caps #479
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#479
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?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/475
Author: @Sunt-ing
Created: 10/15/2026
Status: 🔄 Open
Base:
nv_dev← Head:fix/sm120-split-k-sf-alignment📝 Commits (1)
26f1584Fix SM120 split-K alignment after partition caps📊 Changes
2 files changed (+15 additions, -3 deletions)
View changed files
📝
csrc/jit_kernels/heuristics/sm120.hpp(+4 -3)📝
tests/test_sm120_gemm.py(+11 -0)📄 Description
The SM120 split-K heuristic checks scale alignment before capping the partition count. Those caps can break alignment and produce incorrect FP8 GEMM results. Move the alignment search after both caps and add regression tests.
Adapts the fix from vllm-project/DeepGEMM#4 to
nv_dev, reusing the existing search.Reproduction and validation
For
(M, N, K) = (32, 64, 2560), the heuristic first selects 5 aligned partitions, then caps this to 2. Each partition spans 10 K blocks, violating the kernel's four-block scale-tile alignment.The regression covers float and packed scales at K=2048/2560/3584/4096. On an RTX 5090, the original and rebuilt revert fail 4 of 8 cases; the fix passes all 8. The default scaling path also fails in a BF16→FP8 linear→residual→SiLU operator chain at width 2560 for both tested seeds, and passes after the fix. Whole-model accuracy impact and production frequency were not measured.
CUDA Graph benchmarks used explicit
recipe=(1, 1, 128), per-token scales for both operands, and FP32 output. Median fixed/original latency ratios across six paired rounds show approximately 16% and 44% longer execution for 32×64×2560 and 32×64×3584, and 7% for 32×2560×2560. The original outputs at these points are incorrect. The paired median changes for four correctly computed controls were within 0.2%; 64×2560×2560 improved by approximately 10%.Base:
nv_devatb64107f2b9599ca76445b7f62eedf66bae1d095b. Candidate:26f15840f26684c72e1033d2b678b159c7898543.Environment: RTX 5090, driver 580.105.08, PyTorch 2.13.0+cu130. Build DeepGEMM from source with its CUTLASS and DeepJIT submodules; the build environment requires
libdw-dev.The following public-API example uses default scaling. Run the same script with the original and fixed packages installed:
Observed GEMM diff: original/rebuilt revert
0.017614289757198476; fixed1.0103029524088925e-14. The reference decodes the same FP8 operands, separating the computation error from quantization error.Regression command on the candidate:
Additional validation: two existing Graph/PDL/tail tests passed; 56 existing split-K alpha, accumulation, padded-output and swapped-stride cases also passed on driver 590.48.01; the operator chain covered two seeds and widths 2048/2560/3584/4096 with both default and explicit scaling. Performance used six alternating original/fixed rounds over eight shapes, seven Graph timing samples per point, 200 GEMM calls per sample.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.