[Spec Decode] DSpark confidence-scheduled verification - #47808
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
H20 |
|
Hello, I have a question. If cudagraph is changed to AttentionCGSupport.ALWAYS, does the prefill support the full graph mode in common scenarios? This is because the --compilation-config '{"cudagraph_mode": "FULL_AND_PIECEWISE"}' can be configured. |
|
VLLM enables chunked prefill by default. In real-world applications with long context lengths and many batches being a mix of prefill and decode batches, the current cost curve, which only applies to pure decode batches, is ineffective, and the performance gain from enable-adaptive-verification is minimal. Have you considered adding cost data to a piecewise CUDA graph? |
Adaptively sizes the DSpark draft-verification budget from per-request confidence instead of always verifying every drafted token. Motivation: fixed-k speculation collapses at high concurrency — once the GPU saturates, verifying 7 drafts per request burns more compute than the accepted tokens return, dropping below non-speculative decoding (see table).
Design
adaptive_verification_ema_alpha, default 0.8 — measured bias-zero crossing across batch sizes).max_query_len, every captured slot non-empty. RequiresAttentionCGSupport.ALWAYS, which the DSV4 backends report on SM100.Results
DeepSeek-V4-Flash-DSpark, TP=4, SM100 (B300),
speed_bench256 prompts, 512 output tokens; throughput measured at32881ec177; subsequent HEAD commits are audit fixes off the captured-graph hot path (decodemax_q_lensourcing, CPU upper-bound restoration, non-adaptive request-ordering revert to main), accuracy re-validated at HEAD. Output tok/s:Adaptive matches fixed-k within ±3% at c≤64 and preserves the spec-decode win at high concurrency where fixed-k goes underwater (at c=256, fixed 7-token is 33% below no-spec). Acceptance length falls from ~3.9 to 3.5 at c=256 — the budget deliberately trims drafts as verification tokens become expensive. Note: the no-spec arm ran with a co-tenant job on the other half of the node; its numbers are directionally correct but modestly depressed. Adaptive/fixed arms ran on an idle node.
Accuracy (re-measured at HEAD after the audit fixes below): GSM8K 0.945 (c=16) / 0.951 (c=64), 0 invalid (bar 0.84); MTBench 80/80 completed, completions manually checked for repetition/degeneration — none found.
Reproduction commands
Server (all measurements; ablations via the noted config deltas):
"enable_adaptive_verification":false--speculative-configBenchmark harness —
vllm bench serve(the Python implementation; the CLI falls back to it automatically when the optional Rustvllm-rsbinary is absent). If your install ships a Rust binary that rejects any flag below, invoke the Python implementation directly — still repo-only:GSM8K (in-tree runner; 1319 questions, 5-shot, temperature 0):
python tests/evals/gsm8k/gsm8k_eval.py --port 8000 \ --num-questions 1319 --num-shots 5 --max-tokens 256 \ --temperature 0 --max-concurrency 16 # and 64MTBench coherence (80 prompts, temperature 1; inspect the saved completions for repetition/degeneration, not just the completion count):
Throughput sweep (per concurrency; one warmup pass at
--speed-bench-output-len 256 --num-prompts 64 --max-concurrency 32first):--disable-shuffleplus the fixed prompt set gives every arm identical prompts in identical order;output_throughputfrom the result JSON is the tok/s reported above. The prompt set is an internal speed-bench "qualitative" subset; any fixed prompt set of comparable length distribution reproduces the relative behavior, e.g.--dataset-name random --random-input-len 1024 --random-output-len 512.Limitations
Tests
All pass; full pre-commit green. GSM8K eval config added at
tests/evals/gsm8k/configs/DeepSeek-V4-Flash-DSpark-confidence-TP4.yaml.Not a duplicate
Canonical PR for DSpark confidence-based verification; no other open PR touches adaptive draft budgeting.
AI assistance was used for this change (see commit trailers).
🤖 Generated with Claude Code