mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[GH-ISSUE #372] transform_sf_into_required_layout: no SM120/121 (arch_major=12) branch for (gran_mn=1, gran_k=32) NVFP4 expert scales -- blocks DeepSeek-V4 weight loading #179
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#179
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 @zbrad on GitHub (Jul 6, 2026).
Original GitHub issue: https://github.com/deepseek-ai/DeepGEMM/issues/372
Summary
transform_sf_into_required_layoutincsrc/apis/layout.hpphas no branch forarch_major=12(SM120/SM121, i.e. RTX 5090 / RTX Pro 6000 Blackwell / NVIDIA GB10) at the(gran_mn=1, gran_k=32)scale-factor granularity DeepSeek-V4's NVFP4 expert weights use. This is a distinct kernel/dispatch gap from the ones already fixed in #317 / PR #318 (tf32_hc_prenorm_gemm,paged_mqa_logits) -- it blocks DeepSeek-V4 at weight loading time (process_weights_after_loading), before any forward pass is even attempted.Environment
vllm-project/vllm, personal GB10 fork), vendored DeepGEMM at891d57b4(2026-04-24)yujiepan/deepseek-v4-tiny-random-- a small test model whose config faithfully mirrorsdeepseek-ai/DeepSeek-V4-Flash's real quantization scheme (expert_dtype: fp4, samequantization_config), used here specifically to reproduce this on constrained hardwareExact failure
Traceback (vLLM side):
Root cause analysis
transform_sf_into_required_layout(csrc/apis/layout.hpp) has exactly four branches:DeepSeek-V4's NVFP4 expert scales are
(FP32, gran_mn=1, gran_k=32)at call time (upcast from E8M0/uint8 checkpoint storage via_upcast_e8m0_to_fp32on the caller side). None of the four branches match onarch_major=12:gran_k == 128(this call hasgran_k == 32) -- so even withdisable_ue8m0_cast=True(which I confirmed empirically routes vLLM's other(gran_mn∈{1,128}, gran_k=128)fp8-block-scale calls through the arch-agnostic fallback successfully), these two branches still can't match this granularity on any architecture.gran_k == 32) are hard-gated toarch_major == 10only.So
(gran_mn=1, gran_k=32)has no working path on arch_major=12 at all, regardless ofdisable_ue8m0_cast.Confirmed still present on current upstream
Checked against upstream
main(currently1f6f3f3, well past our pinned891d57b4), including the most recent commit that touched this exact file (54e22612, "Multiple updates and refactorings (#364)", 2026-06-23) -- that commit added apsum_layoutparameter to the function signature but did not add anyarch_major == 12branch. The gap is still present on latest upstream.Impact
Blocks DeepSeek-V4 (and presumably any other model using this same NVFP4
(1, 32)-granularity expert-scale layout through DeepGEMM'stransform_sf_into_required_layout) from loading at all on any SM120/SM121 GPU, independent of the forward-pass blockers already tracked in #317. This is a separate, earlier failure point (weight loading, not inference).Related issues
tf32_hc_prenorm_gemm,paged_mqa_logits); this issue is a third, distinct gap in the same DeepSeek-V4-on-SM120 effort, not covered by that PRRequest
Would the team consider either:
arch_major == 12branch for(gran_mn=1, gran_k=32)(and128) mirroring the existing SM100 branches (3/4 above), ordisable_ue8m0_castfallback to also covergran_k == 32, if that's numerically valid?As with #317, a reference implementation or guidance on the expected approach would help the community contribute, given the team's stated capacity constraints for SM120 hardware.
@lucifer1004 commented on GitHub (Sep 16, 2026):
#447 adds the arch_major == 12 branch to
transform_sf_into_required_layout(csrc/apis/layout.hpp):(gran_mn=1, gran_k=32)float SFs go throughget_mn_major_tma_aligned_packed_ue8m0_tensor(gran_mn==1 needs no broadcast), and prepacked int input is validated bycheck_sf_layout. The backing transforms are arch-generic smxx JIT kernels with a torch fallback for odd shapes.Coverage on arch 12:
test_sm120_symmetric_fp4_mn(recipe (1,1,32) dense fp4, both SF orientations) and the NVFP4 m-grouped expert-scale recipes intest_sm120_gemm.py. This unblocks DeepSeek-V4 NVFP4 expert weight loading on SM120/SM121.