Repository navigation
Conversation
…d cutedsl_mla from sgl-project#48414 Copy the Day-0 hunks that serve a DFLASH MLA draft's sliding_attention layers on the MLA-only draft backends: the per-row window index kernel (mla_window_sparse_indices), trtllm_mla's sliding-window verify path over trtllm-gen sparse MLA (with the rank-local LSE under DCP), the MLA-only draft backend admission, and the compact draft window resolution. Co-authored-by: Yuhao Yang <[email protected]>
…_draft_config Main's parse_dflash_draft_config reads is_mla through _parse_dflash_is_mla, which accepts a scalar attention_mode without num_hidden_layers. The Day-0 get_dflash_attention_modes rejects that, so restore main's parser and make is_dflash_mla_draft_config, the name the ported hook and window resolution call, a thin entry over it.
Day-0 defaults it to SGLANG_ENABLE_NV_MEGA_RUNTIME_K31_GB_OPTIMIZATION, which main does not have.
The draft KV ring is not ported, so the sliding-window path always reads the draft's keys through req_to_token and the runner's page table.
…layers Day-0 drops the triton-only check and rejects windows in FlashInfer MLA's causal planning, which main replaced with _planned_causal. Keep main's check in DFlashMLAAttention and widen it to the window-capable backends, resolving with algo_label="DFLASH" so an MLA-only backend is not silently replaced by the platform fallback.
…aft comment KVCacheConfigurator.draft_mla_rows_are_physical is Day-0's; on main the draft's row space comes from draft_loc_space_scale.
This was referenced Nov 8, 2026
Collaborator
Author
|
Accuracy at #49110 merged with #48741 (
Same setup and eval as #48741 (comment) (sgl-eval 0.1.3 GSM8K, 200 examples, temperature 1.0, top_p 0.95). Accept len is the decode server's logged mean over batches of 8 or more running requests. |
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.
Original authors: @yhyang201
Port of #48414
A DFLASH MLA draft whose layers are all
sliding_attention(the Kimi-K3.1 DFlash2 SWA drafts) cannot run under Kimi-K3.1 DCP on main: the K3.1 override requires--speculative-draft-attention-backend cutedsl_mlawith DCP + DFLASH, whileDFlashMLAAttentionaccepts onlytritonfor sliding layers. It also resolved the draft backend withoutalgo_label="DFLASH", so a requestedcutedsl_mlasilently becameflashinferin that check. This PR ports the Day-0 window path that serves these layers on the MLA-only draft backends:mla_window_sparse_indiceslists, per query row at positionp, this rank's keys in[p - window_left, p].trtllm_mla(andcutedsl_mla, which inherits its target-verify path) runs a sliding layer through trtllm-gen sparse MLA over those lists (_forward_sliding_window). Under DCP it returns the rank-local(out, lse)for the existing merge, with the LSE base each backend declares (dcp_lse_base_on_e).trtllm_mla/cutedsl_mlafor MLA drafts (DFLASH_MLA_ONLY_DRAFT_BACKENDS), and--speculative-draft-window-sizeis resolved against the draft's own window on those backends (_resolve_dflash_mla_draft_window).Against the raw port (first commit):
_parse_dflash_is_mlastays;is_dflash_mla_draft_configis a thin entry over it.SGLANG_OPT_DFLASH_SWA_SKIP_LSEdefaults off (its Day-0 default reads an env var main does not have).req_to_tokenwithout a draft KV ring.DFlashMLAAttentionkeeps main's sliding-layer check, widened totriton,trtllm_mlaandcutedsl_mla, and resolves the backend withalgo_label="DFLASH".Left for later ports: the draft KV ring (
dflash_draft_ring.py; the window kernel keeps its ring arguments), L2 prefetch, simulated acceptance, the fused candidate all-gather, the grouped-conv kernel, the megakernel pre-built FP8 query, andSGLANG_TRTLLM_MLA_WORKSPACE_MB.Modifications
kernels/ops/attention/mla_window_indices.py: per-row window key indices, DCP owner filtering.layers/attention/trtllm_mla_backend.py,cutedsl_mla_backend.py,dsa/dsa_dcp.py: the sliding-window target-verify path and its LSE handling.speculative/dflash_utils.py,speculative/draft_worker_common.py,arg_groups/speculative_hook.py,models/dflash.py,environ.py: draft backend admission and compact-window resolution.Tests
test_mla_window_indices.py(kernel),test_dflash_mla_draft_window.py;test_dflash_mla.pynow checks the three window backends. None has run yet.ruff check --select F,E9,ruff format, and pre-commit on the touched files.cutedsl_mla, GSM8K via sgl-eval, plus acceptance length against the same draft ontritonwithout DCP.CI States
Latest PR Test (Base): ❌ Run #42435247021
Latest PR Test (Extra): ❌ Run #42435246838
Latest PR Test (AMD ROCm 10): ❌ Run #42435246935
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: