Repository navigation
[TRTLLM-14620][feat] Add confidence-guided dynamic verification for DeepSeek-V4 DSpark - #18392
Closed
zhaoyuanh-nvidia wants to merge 5 commits into
Closed
zhaoyuanh-nvidia wants to merge 5 commits into
zhaoyuanh-nvidia wants to merge 5 commits into
Conversation
zhaoyuanh-nvidia
force-pushed
the
feature/dsv4-dspark-confidence-head
branch
2 times, most recently
from
August 31, 2026 01:59
60ec034 to
b1dde8d
Compare
This was referenced Sep 1, 2026
zhaoyuanh-nvidia
force-pushed
the
feature/dsv4-dspark-confidence-head
branch
9 times, most recently
from
September 7, 2026 08:01
9967579 to
38a5b33
Compare
This was referenced Sep 29, 2026
zhaoyuanh-nvidia
force-pushed
the
feature/dsv4-dspark-confidence-head
branch
from
October 6, 2026 20:25
f49ef1e to
1ec04e5
Compare
zhaoyuanh-nvidia
force-pushed
the
feature/dsv4-dspark-confidence-head
branch
from
October 16, 2026 09:40
1ec04e5 to
790bd2c
Compare
zhaoyuanh-nvidia
force-pushed
the
feature/dsv4-dspark-confidence-head
branch
6 times, most recently
from
November 2, 2026 13:52
d80f6e4 to
a65862a
Compare
zhaoyuanh-nvidia
force-pushed
the
feature/dsv4-dspark-confidence-head
branch
from
November 2, 2026 19:46
a65862a to
39e72e0
Compare
Add confidence-guided verification for embedded DeepSeek-V4 DSpark decode batches. A trained confidence head scores the drafted positions, and in decode-only steps the runtime may verify fewer rows, choosing among budgets whose step times were measured in a cost table. Drafting still produces the full block, and target verification and acceptance are unchanged. The feature is experimental and disabled by default. - Config: enable_confidence_scheduling, confidence_cost_table_path, confidence_calibration_path and confidence_min_predicted_gain (0.04). Unsupported combinations are rejected at config validation, including the acceptance-rate gate and graph-disabling dynamic EPLB. - Cost tables hold several K. Startup checks the entry for max_draft_len, a row per captured CUDA-graph batch size and the measured setup; tables in the earlier single-K format still load. - tensorrt_llm.tools.dspark_profile_costs profiles a table for a runtime YAML and adds or replaces the profiled (K, G) rows of an existing file. - Connect the policy to decoder inputs, metadata, graph selection and attention-DP executor scheduling, reserve the native KV-cache index slots, and remove the planner's admission-receipt, live-fingerprint and drain-guard code, which had no public producer. - Document the opt-in and the cost-table workflow in the DeepSeek-V4 README. Signed-off-by: Zhaoyuan He <[email protected]>
Document how to reproduce the DeepSeek-V4-Pro confidence-scheduling results end to end: results from BS128 to BS4096 and on long prompts, runtime YAMLs and why each setting was chosen, dataset format, cost-table reuse and generation with tensorrt_llm.tools.dspark_profile_costs, calibration, benchmark commands, the throughput metric and the startup errors. Ship the cost tables measured on 8x B300 with DEP8 (K3/K4/K5 for graph sizes 16-128, K4/K5 for 16-256, K5 for 16-512) and the matching calibration so the same setup can reuse them. Signed-off-by: Zhaoyuan He <[email protected]>
zhaoyuanh-nvidia
force-pushed
the
feature/dsv4-dspark-confidence-head
branch
from
November 2, 2026 20:08
39e72e0 to
bad3954
Compare
Rewrite CONFIDENCE_REPRODUCTION.md around the four-dataset real-data sweep (SPEED-Bench, Arena-Hard, ShareGPT, GSM8K) on 8xB300 DEP8, with equal-speed and same-batch-size results, and replace the short-prompt synthetic section. Add dspark_benchmark/ so the results can be reproduced from public data: - build_datasets.py rebuilds the benchmark prompt files from pinned Hugging Face revisions and checks them against datasets_manifest.json, which stores only record IDs and truncated text hashes. - make_configs.py writes the fixed-K and confidence configs per batch size. - run_benchmark.sh and sampler.yaml run one trtllm-bench setting. - analyze.py averages repeats and computes the equal-speed comparison. Replace costs-b300-dep8.json with the cost table used for all real-data runs and remove the separate BS2048/BS4096 tables. Document a sweep of confidence_min_predicted_gain (0-8%), which is flat on real data, so the 4% default stays and configs leave the knob unset. Signed-off-by: Zhaoyuan He <[email protected]>
Expose enable_fused_confidence_scheduler on the DSpark config (default off) and pass it to the verify planner. With it on, compact steps keep the host's verifier budget but re-rank which draft positions are verified on the GPU, using the confidence of the block being verified instead of the previous step's host copy. The device path already exists in the input preparer and attention metadata; until now no setting turned it on. On DeepSeek-V4-Pro (8x B300, attention DP) it raised throughput in 13 of 15 dataset and batch-size settings, by up to 5.5%, and lowered it in two (-2.2% and -0.4%). GSM8K accuracy was unchanged. It stays opt-in. Update the serve config schemas and the LLM-args telemetry manifest for the new field, and add config and worker tests. Signed-off-by: Zhaoyuan He <[email protected]>
make_configs.py --rerank also writes bs<BS>-confidence-rerank-k<K>.yaml, the confidence config with enable_fused_confidence_scheduler on, so the option is one flag away. analyze.py counts those runs as confidence scheduling, labels them, and keeps the faster setting at each batch size. The guide shows the option in the quick start, the example config and the run instructions, and section 8 explains it with an A/B over 15 dataset and batch-size settings (same node, two runs each) and a GSM8K accuracy check. Troubleshooting moves to section 9. Signed-off-by: Zhaoyuan He <[email protected]>
Collaborator
Author
|
Closing this PR as the DSpark confidence head implementation has been merged into main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Umbrella for confidence-guided verification in embedded DeepSeek-V4 DSpark. A trained confidence head scores the drafted positions, and in decode-only steps the runtime may verify fewer rows, choosing among budgets whose step times were measured in a cost table. Drafting still produces the full block, and target verification and acceptance are unchanged. The feature is experimental and disabled by default.
This branch is the head of #20078 merged with current main (PR6, the last implementation PR; PR1-PR5 are merged, including #20072) plus a reproduction guide, benchmark scripts and the measured B300 artifacts. It is kept as a draft for review and reproduction; code changes land through the stacked PRs.
Reproduce
Follow
CONFIDENCE_REPRODUCTION.md. The scripts indspark_benchmark/cover each step:build_datasets.pyrebuilds the four prompt sets from pinned Hugging Face revisions and checks them against the published files.make_configs.pywrites the fixed-K and confidence runtime YAMLs for each batch size.run_benchmark.shruns one setting withtrtllm-bench.analyze.pyaverages repeats and compares the methods at equal per-user speed.Enabling the feature takes three settings:
Reuse a table:
dspark_artifacts/costs-b300-dep8.jsonholds K3 and K4 for graph batch sizes 16-256 and K5 for 8-256 on 8x B300 with attention DP and 8-way EP, with the matching calibration. It covers every configuration in the guide. Startup stops with the command to regenerate if the table has no entry formax_draft_len, lacks a captured graph batch size, or was measured on another GPU model or parallel layout; a different TensorRT LLM version only warns.Generate one (about 10 minutes per K on 8x B300):
Results
One node of 8x B300, attention DP with 8-way EP, FP8 KV cache, main (2d1a7d1) plus #20078. Each dataset was sent at constant concurrency equal to the batch size (64 to 2048). Decoding is greedy, and requests stop at end-of-sequence or after 1,024 output tokens.
Confidence scheduling (K3-K5) against fixed DSpark draft lengths (K1-K5) at equal per-user speed: for each method the best points over all batch sizes and draft lengths form a line, and the table shows where the confidence line is furthest above the fixed one.
Best fixed draft length against the best confidence setting at the same batch size:
confidence_min_predicted_gain, default 0.04) was swept from 0 to 0.08 on SPEED-Bench and ShareGPT at batch sizes 256-1024; every setting was within run-to-run variation of the default, so configs leave it unset.Device re-ranking (this branch only)
This branch also adds an opt-in setting,
enable_fused_confidence_scheduler: trueinspeculative_config, that keeps the host's verifier budget but re-ranks which draft positions are verified on the GPU with the confidence of the block being verified.make_configs.py --rerankwrites these configs, and the analysis keeps the faster setting at each batch size. Over 15 dataset and batch-size settings (same node, two runs each) it raised throughput in 13, by up to 5.5% (Arena-Hard +3.4% to +5.5%, ShareGPT +3.3% at BS256-1024), and lowered it in two (SPEED-Bench BS384 -2.2%, GSM8K BS256 -0.4%). GSM8K accuracy was unchanged (96.6-96.8% with it, 96.8% without). Details: section 8 of the guide.Remaining work
Keep this PR draft.