Add DSpark block drafter support - #2462
Closed
Tianlei Wu (tianleiwu) wants to merge 1 commit into
Closed
Conversation
Reuse the DFlash2 lattice runtime while adding DSpark graph export, shared initializer plumbing, and full-attention cache accounting.
Contributor
Author
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.
Description
Adds end-to-end DSpark speculative decoding support for Qwen3.8 models. The implementation
reuses the DFlash2 block-drafter lattice runtime introduced by #2460, while adding DSpark
graph export, Markov scoring, shared target weights, and cache accounting for both full and
sliding-window draft models.
This PR is intentionally stacked on #2460 and should be reviewed after that PR.
Summary of Changes
DSpark model export
src/python/py/models/builders/dspark.pysrc/python/py/models/builders/qwen.pymodel.dsparkconfiguration.Runtime integration
src/config.cppmodel.dsparkthrough the common block-drafter configuration.src/dflash2_drafter.hsrc/dflash2_drafter.cppsliding_window.src/engine/engine.cppTesting
cmake --build build/cuda130/Release --parallel./build/cuda130/Release/engine_unit_testspython3 -m py_compile src/python/py/models/builders/dspark.py src/python/py/models/builders/qwen.pyp=0.508).p=0.143).Motivation and Context
DSpark extends the DFlash-style parallel block drafter with a low-rank Markov head. Both
models expose the same candidate lattice to the runtime, so sharing the proposal and
verification path avoids a second speculative-decoding implementation.
The evaluated Qwen3.8 checkpoint uses full attention and therefore grows its draft KV cache
with resident context. DSpark is not inherently limited to full attention: positive
sliding_windowconfigurations use the existing fixed-ring path.Checklist