feat(ds4): add DSpark speculative decoding (+27% on Strix Halo)#496
Conversation
|
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. |
|
Updated DSpark adaptive width in
Validation on lucebox2 / gfx1151 with the exact committed source:
The confidence policy therefore retains essentially all high-acceptance throughput while adapting verification width on harder prompts. |
1fc4f00 to
867c9b8
Compare
e943f2a to
d5fae56
Compare
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.
726cc05 to
415432f
Compare
There was a problem hiding this comment.
All reported issues were addressed across 14 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 15 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
2 issues found across 15 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="server/src/deepseek4/deepseek4_dspark.h">
<violation number="1" location="server/src/deepseek4/deepseek4_dspark.h:132">
P3: `GenerateRequest` forward declaration is unused and suggests a dependency this API does not have; remove it to keep the DSpark interface minimal.</violation>
</file>
<file name="server/src/deepseek4/deepseek4_dspark_spec.cpp">
<violation number="1" location="server/src/deepseek4/deepseek4_dspark_spec.cpp:462">
P3: After the feature window fills, every committed token copies the entire DSpark context window, adding avoidable multi-megabyte host-memory traffic to the decode hot path. Keep feature columns in a circular buffer (materializing contiguous context only when required) so speculative throughput does not degrade after 128 positions.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Summary
DFLASH_DS4_SPEC=1Rebase and hardening
This branch is rebuilt directly on current
mainafter #502 and #503 merged. The rebase removes the old stacked-branch conflict and includes lifecycle/error-path hardening found during review:Strix Halo validation
Validated on a 128 GiB Strix Halo Radeon 8060S with ROCm 7.2.4, monolithic fused decode,
--ds4-expert-top-k 4, platform profileperformance, and GPU performance levelhigh.Weighted throughput is total completion tokens divided by summed decode time. The measured DSpark uplift over the matched AR control is about 24%.
The 30+ tok/s result is configuration-specific: DSpark, fused decode,
--ds4-expert-top-k 4, and the stated performance/high clock profiles. The expert-top-k flag is a separate approximate inference policy, not part of DSpark itself. Batched and token-at-a-time graph shapes can also differ around near-tied logits; quality was scored directly rather than claiming bit-for-bit AR equivalence. The DS4 documentation now calls out thatDFLASH_DS4_FUSED_VERIFY=1is the opt-in throughput profile and is not a byte-identity mode.Follow-up
Remote DSpark execution and shared transport remain isolated in #505.