Skip to content

[Spec] Support ReplaySSM spec-verify for DFlash and DSPARK on hybrid GDN models - #36683

Open
EanWang211123 wants to merge 4 commits into
sgl-project:mainfrom
EanWang211123:feat/ssm-ring-replay/main
Open

EanWang211123 wants to merge 4 commits into
sgl-project:mainfrom
EanWang211123:feat/ssm-ring-replay/main

Conversation

@EanWang211123

@EanWang211123 EanWang211123 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

ReplaySSM spec-verify support was introduced for MTP in:

It avoids storing a full intermediate SSM state for every draft token. Instead, the verify stage stores compact raw inputs in ReplaySSM buffers and folds only the accepted prefix into the persistent SSM state after verification.

DFlash and DSPARK have their own post-verify state commit paths, so hybrid GDN models could not reuse the existing ReplaySSM implementation. Enabling --enable-linear-replayssm-spec with these algorithms was therefore rejected or could fall back to a commit path that expects intermediate_ssm.

This PR connects DFlash and DSPARK to the existing ReplaySSM fold-every-commit path while preserving their original KDA and non-ReplaySSM behavior.

Modifications

  • dflash_worker_v2.py

    • Route DFlash GDN ReplaySSM states through the common post-verify commit path.
  • dspark_worker_v2.py

    • Add GDN ReplaySSM state commit support for DSPARK.
  • kv_cache_configurator.py

    • Allow DFlash and static-mode DSPARK to use ReplaySSM with hybrid GDN models.

Accuracy Tests

Speed Tests and Profiling

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.

CI States

Latest PR Test (Base): ❌ Run #37716399910
Latest PR Test (Extra): ❌ Run #37716399565
Latest PR Test (AMD ROCm 10): ❌ Run #37716399934

@EanWang211123
EanWang211123 marked this pull request as ready for review August 27, 2026 10:19
@EanWang211123 EanWang211123 changed the title [Spec] Support ReplaySSM spec-verify for DFlash and DSPARK GDN [Spec] Support ReplaySSM spec-verify for DFlash and DSPARK on hybrid GDN models Aug 27, 2026
@stefanskiasan

Copy link
Copy Markdown

Tested this PR as a Python-only overlay on the released v0.5.19 image (no rebuild): all helper symbols it relies on — commit_mamba_states_after_verify, replayssm_spec_fold/replayssm_is_kda, hybrid_gdn_config, and ragged_verify — already ship in 0.5.19, so the 3-file diff applies cleanly with patch -p1 --fuzz=5.

Ran DFLASH (jzinno/Ornith-1.5-35B-A3B-DFlash2) against Ornith-1.5-35B-A3B (FP8, W8A8) on a single H100 94GB with --enable-linear-replayssm-spec --mamba-radix-cache-strategy no_buffer --disable-overlap-schedule --attention-backend flashinfer:

  • Before the patch: ValueError: --enable-linear-replayssm-spec with DSPARK/DFLASH requires a KDA (kimi_linear) model — i.e. DFLASH+GDN was hard-rejected.
  • After the patch: the rejection is correctly lifted, GDN kernels + the DFLASH draft CUDA graphs init cleanly, and it serves. Accept-length up to 8.7 on structured/repetitive output, ~2.6–7.6 on code/JSON → 2.5–3.1× single-stream decode speedup on code/JSON, lossless (exact verify). Free-form prose lands ~2–3 accept as expected.

Confirms DFLASH + GDN + ReplaySSM works on Hopper for the Qwen3.5-A3B lineage, not just KDA. Would love to see this merged. Thanks for the work!

@EanWang211123
EanWang211123 force-pushed the feat/ssm-ring-replay/main branch from 9b2e85b to 5c07ac5 Compare September 14, 2026 03:20
Li-brua pushed a commit to Li-brua/sglang that referenced this pull request Sep 17, 2026
@EanWang211123
EanWang211123 force-pushed the feat/ssm-ring-replay/main branch from 5c07ac5 to 532c689 Compare September 21, 2026 02:29
Signed-off-by: EanWang211123 <wangyiheng@sangfor.com.cn>
Signed-off-by: EanWang211123 <wangyiheng@sangfor.com.cn>
Signed-off-by: EanWang211123 <wangyiheng@sangfor.com.cn>

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants