Skip to content

[GDN] Honor configured linear-attn verify backend in the kernel dispatcher - #34592

Merged
BBuf merged 2 commits into
mainfrom
gdn-verify-backend-dispatch
Aug 14, 2026
Merged

BBuf merged 2 commits into
mainfrom
gdn-verify-backend-dispatch

Conversation

@BBuf

@BBuf BBuf commented Aug 12, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

GDNKernelDispatcher derives its verify kernel purely from whether the decode or prefill backend selected FlashInfer, silently overriding an explicitly configured --linear-attn-verify-backend. The server logs end up contradicting themselves:

Linear attention kernel backend: decode=triton, prefill=flashinfer, verify=triton
GDN kernel dispatcher: decode=TritonGDNKernel, extend=FlashInferGDNKernel, verify=FlashInferGDNKernel

This matters on SM90: the FlashInfer MTP verify path (flashinfer.gdn_decode.gated_delta_rule_mtp) asserts a fp32 SSM state, so any GDN model served with --mamba-ssm-dtype bfloat16 crashes at startup as soon as NEXTN speculative decoding is enabled — and there is currently no way to force the Triton verify kernel (which handles bf16 state fine) because the flag is ignored:

AssertionError: initial_state must be float32, got torch.bfloat16

Modifications

GDNKernelDispatcher takes the configured verify backend; an explicit triton choice now wins, while the existing auto rule (FlashInfer verify when the selected FlashInfer kernel supports MTP verify) is unchanged when the flag is unset.

With the fix, --speculative-algorithm NEXTN + --mamba-ssm-dtype bfloat16 + --linear-attn-verify-backend triton compose. Measured on a GDN hybrid 27B (FP8) on 1x H200, 4096-in/1024-out: bs=64 2092.7 -> 2143.4 output tok/s vs the previous best non-composable configs, bs=1 266.3 with accept length 2.5-3.1, GSM8K-500 accuracy unchanged (0.954) vs the fp32-state gate.

Checklist

  • Format your code with pre-commit
  • Benchmark + accuracy evidence above

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): ❌ Run #31689642600
Latest PR Test (Extra): ❌ Run #31689642504

GDNKernelDispatcher derived the verify kernel purely from whether decode or
prefill selected FlashInfer, silently overriding --linear-attn-verify-backend.
On SM90 the FlashInfer MTP verify path (gated_delta_rule_mtp) asserts a fp32
SSM state, so NEXTN speculative decoding could not be combined with
--mamba-ssm-dtype bfloat16 at all. An explicitly configured triton verify
backend now wins; the auto rule is unchanged otherwise.

Qwen3.8-27B-FP8 1xH200 4096in/1024out: MTP(3/1/4) + bf16 SSM state now runs,
bs=64 2092.7 -> 2143.4 tok/s (vs previous best per-shape split), bs=1 266.3,
GSM8K-500 0.954 (unchanged vs fp32-state gate).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@BBuf BBuf added run-ci CI: run the baseline test suite on this PR bypass-fastfail run-ci-extra CI: also run the extra suite (requires run-ci) labels Aug 13, 2026
@BBuf
BBuf merged commit 704e512 into main Aug 14, 2026
137 of 188 checks passed
@BBuf
BBuf deleted the gdn-verify-backend-dispatch branch August 14, 2026 00:59
saturn-acc pushed a commit to saturn-acc/sglang that referenced this pull request Aug 16, 2026
…tcher (sgl-project#34592)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Atituiset pushed a commit to Atituiset/sglang that referenced this pull request Sep 10, 2026
…tcher (sgl-project#34592)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-fastfail run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant