[WIP][Spec Decode] DSpark confidence-scheduled verification#47808
[WIP][Spec Decode] DSpark confidence-scheduled verification#47808LucasWilkinson wants to merge 19 commits into
Conversation
e4457cf to
9b3a024
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
9b3a024 to
f4ee8d9
Compare
a36535e to
df8a2f8
Compare
c1a2f3c to
5d3d111
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
|
Hi, I am learning about DSpark and glad to see a working implementation! I wanted to check one design point against the DSpark paper before I rely on this. As I read the paper, the confidence-based prefix scheduler splits the decision in two: the total verify budget for a step is set from the confidence data two steps earlier, but the per-request verify length is then allocated from the current step's confidence.
In this PR it looks to me like both quantities come from the same two-steps-earlier snapshot rather than being split. Is that an intentional simplification for now, or is matching the paper's fresher per-request allocation something you're planning? Possibly I'm misreading the flow — happy to be corrected. |
903f5d9 to
83eedaf
Compare
83eedaf to
33fd780
Compare
Implement host-side confidence scheduling for DSpark with automatically selected compact or masked verification, request-conditioned SPS profiling, and online temperature calibration. Centralize scheduling and batch transformation in ConfidenceManager, use a fixed two-slot pinned-host copy ring, fuse compact batch rewrites, and keep shared model-runner and warmup hooks minimal. Validated with focused CUDA tests, a GPU-sync-checked serving probe, GSM8K, and a 25-cell natural-EOS throughput matrix. Co-authored-by: OpenAI Codex <codex@openai.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Minimize shared-path changes, simplify confidence staging, and retain bounded varlen CUDA-graph dispatch. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Fit additive draft-request and verifier-token timing curves during automatic SPS profiling while retaining the existing scheduler lookup path. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Name the fitted request-count term for all request-shaped work, including fixed masked-verifier overhead, without changing scheduling behavior. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Measure draft and verifier costs directly for SPS scheduling. Keep the host-derived verification budget delayed while assigning that budget from current GPU prefix scores, matching the paper without expanding the shared model-runner path. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Apply the delayed token budget to the latest asynchronously staged confidence snapshot on the host. This preserves the paper's fresh per-request ordering while removing the generic per-step GPU sort and its buffers. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Use the paper's SPS objective argmax directly instead of requiring an additional five-percent predicted gain before pruning. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Choose one stale SPS budget on TP rank zero, then assign that budget from current confidences on the GPU. Keep compact verification metadata device-resident while retaining only the aggregate host shape needed for CUDA graph selection. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
e5f37eb to
1e8070e
Compare
Keep draft and verifier costs as separate one-dimensional tables, compute current confidence ordering only on TP rank zero, reduce manager staging state, and retain two request-count CUDA graph tiers. Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
1e8070e to
5716900
Compare
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
This PR implements confidence-scheduled speculative verification for
DSpark. The confidence head predicts each
draft token's acceptance probability; the host scheduler prunes verification
work that is not expected to pay for its target-model cost.
confidence_based_verificationcontrols the feature:noneandoffdisableit,
autouses compact verification when the attention backend supports therequired full CUDA graphs and otherwise falls back to masking, and
maskforces the masked path.
through
VLLM_MOE_SKIP_PADDING.full CUDA graphs for the target verification and draft query steps.
This builds on #47469 (SM100 DSA varlen decode). #47513 is the padded/full-CUDA-
graph comparison point. It replaces #47694, which was opened from the wrong
fork.
Scheduling and execution
The paper's prefix scheduler runs on the host. Each draft token receives its
cumulative prefix-survival probability. Tokens are considered globally in
score order, and the scheduler chooses the admission count that maximizes
expected accepted tokens times the profiled step rate.
dspark_budget_fraccaps admission, while
dspark_confidence_thresholdprovides direct thresholdmode.
Automatic profiling measures overlapping end-to-end step times and fits an
additive request-sized cost and verification-token cost. Their sum is converted
to the step rate used by the scheduler. The request term captures the parallel
DSpark proposal and other work whose shape does not shrink with verifier
pruning; the verification term captures the prunable token work. In a TP4
varlen profile, request-sized cost was 1.408 ms at 32 requests, 4.021 ms at 128,
and 7.398 ms at 256. The fit RMSE was 0.180 ms. Explicit
(verification_tokens, steps_per_second)breakpoints remain supported.ConfidenceManagerowns scheduling and the mode-specific batch transform. Theshared model runner is limited to request initialization, graph dispatch, batch
trimming, and confidence staging hooks.
Confidence logits and sampler outcomes use a fixed two-slot pinned-host ring.
The previous proposal's copy is consumed at a deterministic later dispatch, so
all TP ranks make the same shape decision without per-step payload allocation.
Compact verification uploads one packed metadata buffer and rebuilds positions,
sequence lengths, logit mappings, and verifier token IDs in one Triton kernel.
Online calibration
dspark_online_stsapplies per-position Sequential Temperature Scaling fromthe rejection sampler's observed accept/reject outcomes. Temperatures are fit
with an order-preserving ECE grid search over binned logits. Data-starved
positions blend toward the pooled fit, and calibration remains the identity
before observations arrive.
Performance
deepseek-ai/DeepSeek-V4-Flash-DSpark, TP4 B300, k=7, probabilistic drafts,speed_bench, 256 prompts, up to 512 generated tokens, temperature 1.0,natural EOS termination, and auto-profiled SPS. Cells are output tok/s /
acceptance length:
All 25 cells completed 256/256 requests. The result is workload-dependent. At
c=128, mask + STS improves throughput by 4.7% over baseline. At c=256, varlen
improves throughput by 2.6% and varlen + STS by 4.2%. The table is reported
without smoothing or a fitted trend line.
Correctness and validation
.venv/bin/python -m pytest tests/test_config.py tests/v1/spec_decode/test_dspark_confidence.py tests/v1/worker/test_gpu_block_table.py -q:183 passed.
.venv/bin/python -m pytest tests/v1/attention/test_dspark_noncausal_sparse_mla.py -q:20 passed, 8 skipped.
.venv/bin/python -m pytest tests/v1/spec_decode/test_dflash_lookahead.py -q:3 passed.
0.9454 accuracy (required 0.9200), invalid rate 0.000.
files; the PR pre-commit and DCO checks are green.
tracebacks.
Duplicate-work check
Searched open PRs by the linked PR number and DSpark confidence/capacity
keywords. The only functional overlap is #47513, which implements padded
verification rather than this host confidence scheduler and compact batch path.
AI assistance
Built with AI assistance (OpenAI Codex and Claude). The human submitter must
review and be able to defend every changed line before undrafting.