Repository navigation
[KDA] Default GLM-5-Next spec verify to the CuTe DSL KDA kernel - #42905
Merged
Merged
Conversation
Contributor
Author
|
/rerun-test test/registered/e2e/models/test_glm53_flash_b200.py |
Contributor
|
🚀 |
4 of 5 tasks
HanHan009527
pushed a commit
to bytedance-iaas/sglang
that referenced
this pull request
Oct 19, 2026
The fused CuTe DSL KDA verify kernel for MTP / speculative decoding (fused_kda_decode_mtp_dspark) used paired FP32 instructions (mul_packed_f32x2 / fma_packed_f32x2) that NVVM only accepts for SM100 and newer, and the KDA backend only ran it on SM100, so Hopper always fell back to the unfused Triton verify path. - kda_decode_mtp.py: a USE_PACKED_FMA constexpr (capability major >= 10) keeps the packed path on SM100 and newer and uses scalar FP32 FMAs on SM90, as cutedsl_gdn_mtp_ring.py does. SM100 compiles the same code as before. - kda_backend.py: the CuTe verify gate accepts SM90 as well as SM100, so servers that select nv_cutedsl (explicitly, or Kimi-K3 through its hook) run the CuTe kernel on Hopper. - glm5_next_hook.py: extend the GLM-5-Next spec default --linear-attn-verify-backend nv_cutedsl (sgl-project#42905) to SM90 when --enable-linear-replayssm-spec is on; SM100 is unchanged. - Tests: the ReplaySSM ring parity test also runs on the 1-gpu-large runner (H100); a new CuTe-vs-Triton verify parity test; CPU tests for the backend gate (SM90 and SM100 admitted, SM80 and SM120 rejected) and for the GLM-5-Next hook (SM90 with and without the ring).
JackChuang
added a commit
to JackChuang/sglang
that referenced
this pull request
Oct 22, 2026
The fused CuTe DSL KDA verify kernel for MTP / speculative decoding (fused_kda_decode_mtp_dspark) used paired FP32 instructions (mul_packed_f32x2 / fma_packed_f32x2) that NVVM only accepts for SM100 and newer, and the KDA backend only ran it on SM100, so Hopper always fell back to the unfused Triton verify path. - kda_decode_mtp.py: a USE_PACKED_FMA constexpr (capability major >= 10) keeps the packed path on SM100 and newer and uses scalar FP32 FMAs on SM90, as cutedsl_gdn_mtp_ring.py does. SM100 compiles the same code as before. - kda_backend.py: the CuTe verify gate accepts SM90 as well as SM100, so servers that select nv_cutedsl (explicitly, or Kimi-K3 through its hook) run the CuTe kernel on Hopper. - glm5_next_hook.py: extend the GLM-5-Next spec default --linear-attn-verify-backend nv_cutedsl (sgl-project#42905) to SM90 when --enable-linear-replayssm-spec is on; SM100 is unchanged. - Tests: the ReplaySSM ring parity test also runs on the 1-gpu-large runner (H100); a new CuTe-vs-Triton verify parity test; CPU tests for the backend gate (SM90 and SM100 admitted, SM80 and SM120 rejected) and for the GLM-5-Next hook (SM90 with and without the ring). Co-authored-by: Han Han <hanhan.hank@bytedance.com>
JackChuang
added a commit
to JackChuang/sglang
that referenced
this pull request
Oct 22, 2026
The fused CuTe DSL KDA verify kernel for MTP / speculative decoding (fused_kda_decode_mtp_dspark) used paired FP32 instructions (mul_packed_f32x2 / fma_packed_f32x2) that NVVM only accepts for SM100 and newer, and the KDA backend only ran it on SM100, so Hopper always fell back to the unfused Triton verify path. - kda_decode_mtp.py: a USE_PACKED_FMA constexpr (capability major >= 10) keeps the packed path on SM100 and newer and uses scalar FP32 FMAs on SM90, as cutedsl_gdn_mtp_ring.py does. SM100 compiles the same code as before. - kda_backend.py: the CuTe verify gate accepts SM90 as well as SM100, so servers that select nv_cutedsl (explicitly, or Kimi-K3 through its hook) run the CuTe kernel on Hopper. - glm5_next_hook.py: extend the GLM-5-Next spec default --linear-attn-verify-backend nv_cutedsl (sgl-project#42905) to SM90 when --enable-linear-replayssm-spec is on; SM100 is unchanged. - Tests: the ReplaySSM ring parity test also runs on the 1-gpu-large runner (H100); a new CuTe-vs-Triton verify parity test; CPU tests for the backend gate (SM90 and SM100 admitted, SM80 and SM120 rejected) and for the GLM-5-Next hook (SM90 with and without the ring). Co-authored-by: Han Han <hanhan7630@outlook.com>
JackChuang
added a commit
to JackChuang/sglang
that referenced
this pull request
Oct 22, 2026
The fused CuTe DSL KDA verify kernel for MTP / speculative decoding (fused_kda_decode_mtp_dspark) used paired FP32 instructions (mul_packed_f32x2 / fma_packed_f32x2) that NVVM only accepts for SM100 and newer, and the KDA backend only ran it on SM100, so Hopper always fell back to the unfused Triton verify path. - kda_decode_mtp.py: a USE_PACKED_FMA constexpr (capability major >= 10) keeps the packed path on SM100 and newer and uses scalar FP32 FMAs on SM90, as cutedsl_gdn_mtp_ring.py does. SM100 compiles the same code as before. - kda_backend.py: the CuTe verify gate accepts SM90 as well as SM100, so servers that select nv_cutedsl (explicitly, or Kimi-K3 through its hook) run the CuTe kernel on Hopper. - glm5_next_hook.py: extend the GLM-5-Next spec default --linear-attn-verify-backend nv_cutedsl (sgl-project#42905) to SM90 when --enable-linear-replayssm-spec is on; SM100 is unchanged. - Tests: the ReplaySSM ring parity test also runs on the 1-gpu-large runner (H100); a new CuTe-vs-Triton verify parity test; CPU tests for the backend gate (SM90 and SM100 admitted, SM80 and SM120 rejected) and for the GLM-5-Next hook (SM90 with and without the ring). Co-authored-by: Han Han <hanhan7630@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Defaults
--linear-attn-verify-backendtonv_cutedslfor GLM-5-Next (Glm5NextForConditionalGeneration) when speculative decoding is on, the flag is unset, and the GPU is SM100-class. Target verify then runs the fused CuTe DSL KDA MTP kernel (conv1d + recurrence in one launch); shapes outside its contract use the Triton verify kernel.Results
GLM-5.3-Flash FP8, 4x GB300, TP4, EAGLE 5/1/6 (
SGLANG_SIMULATE_ACC_LEN=5).Serving, random 8k in / 1k out, prefix cache flushed:
Target verify per layer (Triton conv1d update + recurrence vs fused CuTe DSL kernel), 16 heads, 6 tokens per request,
triton.testing.do_bench_cudagraphon fixed buffers, median of 3:Correctness
GSM8K (
sgl-eval, all 1319 questions, temperature 1.0, top_p 0.95, max_tokens 16384):CI States
Latest PR Test (Base): ❌ Run #37571052144
Latest PR Test (Extra): ❌ Run #37571051946
Latest PR Test (AMD ROCm 10): ❌ Run #37571052093