Skip to content

[srt] Fix sconv state memory corruption on specdec - #34043

Merged
ispobock merged 3 commits into
sgl-project:mainfrom
ekzhang:fix-sconv-spec-prefill-tracking
Aug 9, 2026
Merged

ispobock merged 3 commits into
sgl-project:mainfrom
ekzhang:fix-sconv-spec-prefill-tracking

Conversation

@ekzhang

@ekzhang ekzhang commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

DFlash/DSpark speculative pools corrupt sconv (short-conv) state when the radix cache is enabled for hybrid-SWA models such as Inkling and Inkling-Small.

This is because the mamba tracking was gated on prefill-graph capture, and any requests with a radix cache hit would resolve with all-zero sconv cache tensors.

It would especially affect long-context. We were able to find a 70-problem subset of (SWEBench Verified, SWEBench Pro, and SWEBench Multilingual) where DFlash reduces the pass rate from 55% to 35% due to long-context Inkling rollouts getting stuck and being "forgetful" due to the sconv cache corruption.

After this fix, DSpark / DFlash has parity without speculation on nvfp4.

┌─────────────────────────────┬────────┬────────┬───────┐
│ Arm (fixed build, same day) │ Reward │ Tokens │ Turns │
├─────────────────────────────┼────────┼────────┼───────┤
│ DSpark                      │ 0.486  │ 76.3k  │ 110.9 │
├─────────────────────────────┼────────┼────────┼───────┤
│ nospec                      │ 0.471  │ 74.4k  │ 106.9 │
└─────────────────────────────┴────────┴────────┴───────┘

Modifications

  1. Drop the spec_algorithm.is_none() from mamba index tracking guard
  2. Capture-safety in the sconv backend: a capture warmup batch with no tracking metadata substitutes was inert
  3. Zero the mamba_track_* padding rows in the prefill graph's static input buffers

Verification

  • A/B on one warm DSpark pool: byte-identical 10.5k-token prompts under a fresh vs cache-resumed prefix (cached=8960). Pre-fix: verify logits deviate 0.5–3.0 with greedy top-1 flips from the second step. Post-fix: bit-identical (0.0000) at every step, and the donated checkpoints match a non-speculative pool's values exactly.
  • 70-problem SWEBench subset, same-day arms on the fixed build: DSpark reward 0.486 vs non-spec 0.471 (parity within noise; pre-fix 0.257 vs 0.457), with matching token/turn counts.

CI States

Latest PR Test (Base): ❌ Run #31251353987
Latest PR Test (Extra): ❌ Run #31251353876

DFlash/DSpark pools corrupt memory when radix cache is turned on for
models, such as Inkling and Inkling-Small, with SConv.

This is because the mamba tracking was gated on prefill-graph capture,
and any requests with a radix cache hit would resolve with all-zero
sconv cache tensors.

It would especially affect long-context. We were able to find a
70-problem subset of (SWEBench Verified, SWEBench Pro, and SWEBench
Multilingual) where DFlash reduces the pass rate from 55% to 35% due to
long-context Inkling rollouts getting stuck and being "forgetful" due to
the sconv cache corruption.

After this fix, DSpark / DFlash has parity without speculation on nvfp4.

┌─────────────────────────────┬────────┬────────┬───────┐
│ Arm (fixed build, same day) │ Reward │ Tokens │ Turns │
├─────────────────────────────┼────────┼────────┼───────┤
│ DSpark                      │ 0.486  │ 76.3k  │ 110.9 │
├─────────────────────────────┼────────┼────────┼───────┤
│ nospec                      │ 0.471  │ 74.4k  │ 106.9 │
└─────────────────────────────┴────────┴────────┴───────┘
@ekzhang

ekzhang commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Aug 7, 2026
@Qiaolin-Yu

Copy link
Copy Markdown
Collaborator

could you fix the lint

@ispobock ispobock added run-ci-extra CI: also run the extra suite (requires run-ci) bypass-fastfail labels Aug 8, 2026
@ispobock

ispobock commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

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

Labels

bypass-fastfail run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants