[Spec Decode] Enable adaptive verification on DSv4 + sm90 - #52795
Conversation
43b158f to
5a62e20
Compare
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Build flattened indexer metadata from device-side query boundaries when adaptive verification trims SM90 decode batches. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
5a62e20 to
18f9b05
Compare
|
Hi @LucasWilkinson, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
Assisted-by: OpenAI Codex Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
|
/ci run |
|
✅ Triggered Buildkite CI #84477 for commit |
|
Hi @LucasWilkinson, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
|
/ci run |
|
✅ Triggered Buildkite CI #84745 for commit |
…ct#52795) Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Wyett <wyettzeng@gmail.com>
…ct#52795) Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
…ct#52795) Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: khushali9 <khushali.desai9@gmail.com>
…ct#52795) Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: OpenAI Codex <noreply@openai.com>
Purpose
Enable adaptive verification for the DeepSeek V4 indexer on Hopper (SM90).
The native variable-length DeepGEMM paged-MQA path remains restricted to SM100. On SM90, this change instead uses the existing flattened decode path and builds the single-token rows from the device-side decode lengths. This is necessary because adaptive verification can trim each request to a different length while the CPU metadata contains only a uniform placeholder. The builder forces this device-length flattening for adaptive verification, advertises support for the device/CPU query-length mismatch, and enables CUDA graph capture for this path. When there is only one decode request, the CPU and device request boundaries necessarily agree, so that case reuses the cheaper uniform flattened metadata path.
This addresses the Hopper startup failure reported in #47808 (comment).
Duplicate-work check
I searched the open PRs for
adaptive verification Hopper SM90,DeepseekV4IndexerBackend adaptive verification,varlen indexer Hopper, andSM90 DeepGEMM indexer; no open PR implements this fix. #51972 concerns a separate indexer bounds bug, while #47808 is the merged SM100 implementation where the SM90 failure was reported.Test Plan
Targeted correctness and regression tests:
End-to-end validation used DeepSeek-V4-Flash-0731 on 4x H200 (SM90):
DeepSeek-V4-Flash-DSpark-confidence-TP4.yaml. The Blackwell-only--attention_config.indexer_kv_dtype=mxfp4option was removed for Hopper; the rest of the speculative configuration was unchanged.Test Result
use_flattening=True supports_varlen=False.Warmed output throughput (tokens/s):
The concurrency-one regression is reduced but remains a known limitation of this draft. Reusing uniform flattened metadata for a single decode request improved adaptive throughput from 236.9 to 240.2 tokens/s (+1.4%) and reduced mean ITL from 12.455 to 12.355 ms. This matches the metadata microbenchmark: device-ragged preparation took 115.08 us versus 24.14 us for uniform preparation, accounting for about 0.100 ms of the original 0.961 ms per-verification-step gap.
Matched torch-profiler traces show that fixed and adaptive verification both execute an 8-token target graph at concurrency one. Median target GPU execution was effectively identical (10.181 ms fixed versus 10.185 ms adaptive), but the median gap between target graph executions increased from 1.811 to 2.517 ms. The adaptive trace contains one blocking confidence-copy event synchronization per step in
AdaptiveVerificationManager.record_confidences; its approximately 0.706 ms net critical-path effect, together with the 0.100 ms metadata cost, explains most of the original step-latency gap. CUDA graph capture also increased in the TP2 / DP2 comparison (121 s / 4.71 GiB adaptive versus 52 s / 2.61 GiB fixed). The existing SM100 path is unchanged and was not rebenchmarked here.AI assistance
AI assistance from OpenAI Codex was used to investigate, implement, test, benchmark, and draft this PR. Before this draft is marked ready, the human submitter will review every changed line and must be able to defend the change end-to-end.
BEFORE SUBMITTING, PLEASE READ https://docs.vllm.ai/en/latest/contributing