Skip to content

[Fix] spec/dflash: Turn the DFLASH draft KV ring off by default - #51386

Merged
Fridge003 merged 2 commits into
mainfrom
fix/dflash-ring-default-off
Nov 19, 2026
Merged

Fridge003 merged 2 commits into
mainfrom
fix/dflash-ring-default-off

Conversation

@Fridge003

@Fridge003 Fridge003 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

#50740 turned the per-request DFLASH draft KV ring on by default for all-sliding-window MHA drafts (on top of the MLA ring from #49664). Each PD role decides whether to use the ring from its own launch flags only. So when one role can't serve the ring and the other can, the two servers register different state entries and the decode scheduler crashes at bootstrap.

This is what breaks test_glm53_cp_bcg_dflash.py on main (extra-b-test-8-gpu-b300, run):

  • The prefill runs --attn-cp-size 4 --enable-prefill-cp, so the ring turns itself off ("an MHA draft's ring has no context-parallel layout").
  • The decode has no CP, so its ring turns on.
  • The decode then fails with:
RuntimeError: PD state entry mismatch: only the decode server registers a DFLASH draft KV ring

Heterogeneous-TP PD deployments fail the same way.

Modifications

  • SGLANG_ENABLE_DFLASH_DRAFT_KV_RING now defaults to False, so the ring is opt-in.
  • _resolve_dflash_draft_kv_ring: if the switch is set and the launch can't serve the ring, the server now raises a ValueError at launch. Before this change, an unset switch fell back silently, and only an explicit =1 raised. With the new default that silent-fallback branch can never run, and a silent fallback on one PD role is exactly what causes the mismatch above.
  • The PD mismatch message now tells the user to unset the switch on the side that registers the ring, or to set it on both sides.
  • Updated the speculative_dflash_draft_kv_ring help text, the Kimi-K3.1-Pro cookbook notes, and the Kimi K3.1 mamba-ratio calculator. The calculator now counts the ring only when =1 is set.
  • Unit tests: added tests that the ring is off by default, and changed the "off for unsupported launch / draft" cases so they now expect the launch-time error under an explicit opt-in.

Behavior change

The MLA ring (Kimi-K3.1 DFLASH on trtllm_mla / cutedsl_mla) is now off by default too. Deployments that want the ~15% extra target KV need to set SGLANG_ENABLE_DFLASH_DRAFT_KV_RING=1 on both PD roles.

To keep the recommended Kimi-K3.1-Pro deployment unchanged, the cookbook's DFLASH option now sets SGLANG_ENABLE_DFLASH_DRAFT_KV_RING=1 on every NVIDIA cell, including both PD roles. MI350X / MI355X are left alone because they use the Triton draft backend, which has no ring. I rendered every Kimi cell to confirm this. Two things are deliberately left unchanged:

  • The generated AgentX snippet (docs/src/snippets/agentx/...): it is synced from InferenceX and pins its own image.
  • Muse-Spark-Open (MHA ring): it stays off by default.

Checklist

  • pre-commit
  • Unit tests: not run locally (no torch env); relying on CI for test_dflash_draft_kv_ring.py and test_unified_window_wire.py
  • /rerun-test test/registered/e2e/disaggregation/test_glm53_cp_bcg_dflash.py

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): ⊘ Skipped -- add the run-ci label to run CI tests.
Latest PR Test (Extra): ⊘ Skipped -- add the run-ci label to run CI tests.
Latest PR Test (AMD ROCm 10): ⊘ Skipped -- add the run-ci label to run CI tests.

Tip

Base CI only covers the core cases, and its workload may not exercise your change. Use /rerun-test to run the tests your change touches, or copy this prompt for an agent:

Find the registered tests this PR affects and run them with /rerun-test, following https://github.com/sgl-project/sglang/blob/main/.agents/skills/rerun-test/SKILL.md

Each PD role resolves the ring from its own launch flags, so a prefill
that cannot serve the ring (e.g. attn CP) paired with a decode that can
fails the PD state-wire check at bootstrap. Make the ring opt-in via
SGLANG_ENABLE_DFLASH_DRAFT_KV_RING=1; once opted in, an unsupported
launch is a launch-time error rather than a silent fallback.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mintlify

mintlify Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
sglang-doc 🟢 Ready View Preview Nov 19, 2026, 12:38 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

…1-Pro NVIDIA DFLASH commands

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Fridge003

Copy link
Copy Markdown
Collaborator Author

/rerun-tes test/registered/unit/disaggregation/test_unified_window_wire.py test/registered/unit/spec/test_dflash_draft_kv_ring.py test_glm53_cp_bcg_dflash.py

@github-actions

Copy link
Copy Markdown
Contributor

⛔ /rerun-tes isn't a recognized CI command. Did you mean /rerun-test?

See the command reference.

@Fridge003

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/unit/disaggregation/test_unified_window_wire.py test/registered/unit/spec/test_dflash_draft_kv_ring.py test_glm53_cp_bcg_dflash.py

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🚀 ubuntu-latest (2 tests): ✅ View workflow run

cd test/ && python3 registered/unit/disaggregation/test_unified_window_wire.py  # base-a
cd test/ && python3 registered/unit/spec/test_dflash_draft_kv_ring.py  # base-a

🚀 8-gpu-b300 (1 test): ✅ View workflow run

cd test/ && python3 registered/e2e/disaggregation/test_glm53_cp_bcg_dflash.py  # extra-b

@Fridge003
Fridge003 merged commit 981becd into main Nov 19, 2026
148 of 149 checks passed
@Fridge003
Fridge003 deleted the fix/dflash-ring-default-off branch November 19, 2026 05:29
shyeh25 added a commit to shyeh25/sglang that referenced this pull request Nov 19, 2026
Resolve conflicts with the DFLASH confidence-scheduled verify (sgl-project#46190) and
the draft KV ring default (sgl-project#51386): the sparse support runs only without a
planned verify layout, since its accept cannot stop at cutoff_verify_lens;
planned steps keep the dense gather and the cutoff-aware selector accept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fridge003 added a commit that referenced this pull request Nov 19, 2026
… KV ring off by default to release/v1.0.0 (#51386) (#51642)

Co-authored-by: Baizhou Zhang <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

1 active deployment
staging - docs — ad81a0eb Deployed Nov 19, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation speculative-decoding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant