feat: add Qwen3.5 GDN ReplaySSM - #1096
Draft
tuanzhangCS wants to merge 3 commits into
Draft
Conversation
Signed-off-by: tuanzhangCS <tuan@lightseek.org>
Fuse replay payload capture into the existing QKV split and use a cooperative four-warp CTA for NVIDIA 128x128 GDN state heads. Signed-off-by: tuanzhangCS <tuan@lightseek.org>
tuanzhangCS
force-pushed
the
zt/replay_ssm
branch
from
August 14, 2026 08:20
d0bcaf6 to
422fcf5
Compare
Signed-off-by: tuanzhangCS <tuan@lightseek.org>
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.
Summary
Motivation
The previous MTP path saved a full draft SSM state for every speculative token. This makes scratch memory scale with the full recurrent state and adds state-copy work even though verification only commits an accepted prefix.
ReplaySSM stores the per-token K/V/a/b inputs needed to reconstruct the recurrence. Once verification determines the accepted length, the commit path recomputes only the accepted state transitions.
Implementation
Performance
Model:
nvidia/Qwen3.5-122B-A10B-NVFP4on NVIDIA B200.Common settings: input length 128, requested output length 128, greedy decoding, MTP 3 steps / 4 draft tokens, CUDA Graph, FP8 KV cache, three measured runs with the median reported. MTP produced 133 output tokens per sequence in both paths; throughput uses the actual token count.
TP1
TP4
For TP4, the target NVFP4 MoE backend remained FlashInfer TRT-LLM. The BF16 MTP draft MoE used Triton, deterministic communication was enabled, and all-reduce fusion was disabled because the available FlashInfer draft GEMM/custom communication path independently hit an illegal-memory-access error. ReplaySSM was the only A/B difference.
Output token counts and output-ID digests matched between baseline and ReplaySSM for every TP1 and TP4 batch.
Validation
pre-commit run --all-filespytest -q test/runtime/layers/test_gdn_qkv_split_fused.py test/runtime/test_cache_setup.py test/runtime/test_gdn_state_paging.py test/runtime/test_qwen35_gdn_replay.py test/runtime/test_kimi_k3_kda.py— 58 passed, 3 skippedpytest -q test/ops/attention/test_gdn_replay_commit.pyfromtokenspeed-kernel— 11 passed