Skip to content

feat(deepseek4): add DSpark speculative runtime#496

Draft
davide221 wants to merge 3 commits into
codex/ds4-rocmfpx-serverfrom
codex/deepseek4-dspark-draft
Draft

feat(deepseek4): add DSpark speculative runtime#496
davide221 wants to merge 3 commits into
codex/ds4-rocmfpx-serverfrom
codex/deepseek4-dspark-draft

Conversation

@davide221

@davide221 davide221 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Stack

Depends on #503, which depends on #502:

#502 ROCmFPX ggml -> #503 DeepSeek4 target -> #496 DSpark runtime

This branch was rebuilt directly on #503 so it does not carry or conflict with older copies of the target and fused-decode changes.

Summary

  • bridge DeepSeek4/MTP DSpark auxiliary heads into the draft GGUF contract
  • add the DeepSeek4 DSpark loader, proposal graph, target feature capture, batched verification, and rollback loop
  • add confidence-based adaptive verification width while retaining fixed-width controls
  • keep standard AR unchanged unless DFLASH_DS4_SPEC is enabled

Validation

Follow-up

Remote DSpark execution and shared transport are isolated in #505.

@davide221

Copy link
Copy Markdown
Contributor Author

Validation update (2026-07-09): the converter/loader bridge in this PR was validated on lucebox2 with the converted DSpark drafter artifact. In the follow-on DeepSeek4 runtime worktree, DSpark loads successfully, prefill feature capture and generation are wired, the batched-verify causality bug is fixed, and causal batched output matched exact sequential verification in paired probes. Adaptive EWMA width and fused batched verify are working; fused verify reached approximately 20 tok/s (peak 20.1 tok/s), versus roughly 13–15 tok/s for the earlier dynamic causal path. Exact sequential verification measured 1.78–1.91 accepted candidates per 4-candidate step. These runtime changes are follow-on work in the hub-494 experiment worktree and are not claimed as already included in PR 496.

@davide221

Copy link
Copy Markdown
Contributor Author

Updated DSpark adaptive width in 1fc4f00.

  • Fused Markov generation now returns confidence scores in the existing token-id synchronization (no extra host round trip).
  • A compatible confidence head automatically selects q=2/q=3/q=4 from cumulative prefix confidence.
  • Artifacts without a compatible confidence head fall back to the existing EWMA controller.
  • No new environment variables or rejected confidence+EWMA hybrid policy were added.
  • Expert k=3 is not included.

Validation on lucebox2 / gfx1151 with the exact committed source:

  • HIP dflash_server build: pass.
  • GSM 5/5 + MATH 5/5: 10/10.
  • Server-side decode: 1,485 tokens / 50.769 s = 29.25 tok/s weighted.
  • Fixed-q=4 reference: 29.49 tok/s weighted.

The confidence policy therefore retains essentially all high-acceptance throughput while adapting verification width on harder prompts.

Return confidence scores from the fused Markov graph in the existing token-id synchronization, then select q=2/q=3/q=4 from cumulative prefix confidence. Compatible DSpark artifacts enable the policy automatically; artifacts without a confidence head retain the existing EWMA controller. No new deployment configuration is introduced.\n\nValidated on gfx1151: GSM+Math 10/10 at 29.25 tok/s weighted, within 0.8% of fixed q=4, with adaptive behavior retained on low-acceptance prompts.
@davide221 davide221 force-pushed the codex/deepseek4-dspark-draft branch from 1fc4f00 to 867c9b8 Compare July 10, 2026 20:27
@davide221 davide221 changed the title feat(dflash): bridge DeepSeek4 DSpark aux heads feat(deepseek4): add DSpark speculative runtime Jul 10, 2026
@davide221 davide221 changed the base branch from main to codex/ds4-rocmfpx-server July 10, 2026 20:33
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