Skip to content

[SM120] Read FlashInfer 0.7's DSV4 decode dispatch through membership - #42368

Open
juliankang4 wants to merge 1 commit into
sgl-project:mainfrom
juliankang4:dsv4-sm120-flashinfer07-decode-dispatch
Open

juliankang4 wants to merge 1 commit into
sgl-project:mainfrom
juliankang4:dsv4-sm120-flashinfer07-decode-dispatch

Conversation

@juliankang4

@juliankang4 juliankang4 commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #42367.

Motivation

FlashInfer 0.7 changed flashinfer.mla._sparse_mla_sm120._DECODE_DSV4_DISPATCH from a frozenset of (num_heads, topk) pairs to a _DecodeDispatchEnvelope that only answers membership. _flashinfer_dsv4_decode_capabilities() iterates it to collect head counts, so with the FlashInfer that main pins (0.7.0.post1), DeepSeek-V4.1-Flash on SM12x with attention TP > 1 raises TypeError: '_DecodeDispatchEnvelope' object is not iterable while capturing the decode CUDA graphs. Details and a one-line repro are in #42367.

Modifications

  • _flashinfer_dsv4_decode_capabilities() returns the dispatch object as it is, instead of a set of head counts built from it.
  • flashinfer_dsv4_decode_supports_num_heads() asks (num_heads, 512) in dispatch. 512 is the index top-k (index_topk in DeepSeek-V4.1-Flash's config, and DEFAULT_INDEX_TOPK in deepseek_v4_backend.py). FlashInfer 0.6 lists every head count it supports at 512, so the answer there is the same as before. 0.7 accepts any top-k >= 1 for the DSV4 family, so it answers by head count alone.

This is how vLLM reads the same table (has_flashinfer_sparse_mla_sm120_config() in vllm/utils/flashinfer.py). The check stays fail-closed: without the FlashInfer module it still returns False and the padded 64-head path is used.

Tests: test/registered/unit/test_flashinfer_sparse_mla.py, new TestFlashInferDSV4DecodeHeads (CPU), with a fake _sparse_mla_sm120 module in both forms:

  • membership-only envelope: 16 and 12 heads supported, 256 not, nothing above _DECODE_MAX_TOKENS. Fails on main with the same TypeError.
  • 0.6 pair set: 16 supported, 12 not, nothing above _DECODE_MAX_TOKENS. Passes before and after, so 0.6 behaves as before.

Accuracy Tests

No kernel changes. The probe only picks between the native per-rank head count and the padded 64-head decode, which #36655 already treats as equivalent (test_flashinfer_exact_heads_match_padded_64_heads).

End to end on four GB10 (SM121), DeepSeek-V4.1-Flash TP4, 16 query heads per rank: main stops at decode graph capture with the TypeError. With the same membership probe applied, together with #42371 (the fix for #42364, which DeepSeek-V4.1 on SM12x also needs), the server captures its graphs and serves. GSM8K, all 1319, no thinking, temperature 0: 1276/1319. The setup and the rest of the numbers are in #42371.

Speed Tests and Profiling

With FlashInfer 0.7, SM12x TP4 now takes the native 16-head decode that #36655 added, instead of crashing. Decode numbers on GB10 are in #42371.

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

FlashInfer 0.7 turned `_DECODE_DSV4_DISPATCH` from a set of (num_heads, topk)
pairs into a membership envelope that cannot be iterated, so the native-head
probe raised TypeError during DeepSeek-V4 decode CUDA graph capture on SM12x.
Ask it `(num_heads, 512) in dispatch` instead, which both forms answer.
detain added a commit to detain/sglang that referenced this pull request Oct 20, 2026
…indexer) + stack_want decisions

- stack.txt: entries 1-2 (local) + Group A boot-critical indexer chain sgl-project#42371/sgl-project#42861/sgl-project#45261/sgl-project#42294/sgl-project#43008 (fe7be85..0dbd8c5).
- stack_want.txt: consolidated decision set from 8 parallel evaluators + dsv41(422)/SM120(254) sweeps + sybil/qwen harvests.
  Records E verdict (merge only sgl-project#43376) and D verdict (merge only sgl-project#42368; sgl-project#33407/sgl-project#34717 dead on flashinfer 0.7.2).
detain added a commit to detain/sglang that referenced this pull request Oct 20, 2026
… correctness)

- core batch [10-15]: sgl-project#43376 long-ctx indexer OOM bound, sgl-project#42368 FlashInfer-0.7 decode dispatch,
  sgl-project#39914 extra-KV 64-token page split + candidate fallback, sgl-project#42714 graph-safe page-split buffers,
  sgl-project#32464 SM120 sparse-prefill test gate, sgl-project#34027 int32->int64 page-split overflow guard.
- Group C [16-23]: sgl-project#42717 TP-rank verify-budget, sgl-project#43225/sgl-project#43374 compact-verify seq_lens + padding renorm,
  sgl-project#42718 packed-verify token->request map, sgl-project#42713 forced-uniform capture metadata, sgl-project#45301 padded-query
  graph lifetime, sgl-project#44141 bounded-replay guard, sgl-project#45185 V4.1-Flash-1017 FP8 QDQ (env-gated, default OFF).
  sgl-project#42710 skipped (superseded upstream: step_logits already fp32).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] SM120: DeepSeek-V4.1-Flash decode CUDA graph capture fails with FlashInfer 0.7.0 because _DECODE_DSV4_DISPATCH is no longer iterable

1 participant