Repository navigation
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
bench.py measures a speculative-decoding model served by vLLM, using AIPerf as the client and vLLM's per-request spec-decode stats for acceptance. It writes specdec_bench's result files (acceptance_rate.json, timing.json, *_responses.jsonl, configuration.json) with the same acceptance-length definition, without importing or changing specdec_bench, and covers several temperatures and concurrencies against one server. tools/launcher/common/specdec_aiperf/run.sh starts `vllm serve` with the args before `--` and runs bench.py with the args after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: h-guo18 <67671475+h-guo18@users.noreply.github.com>
h-guo18
force-pushed
the
haoguo/specdec-bench-aiperf
branch
from
October 23, 2026 11:30
3a5a23a to
a30cae5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2974 +/- ##
==========================================
- Coverage 79.53% 79.04% -0.50%
==========================================
Files 660 661 +1
Lines 74720 76053 +1333
==========================================
+ Hits 59430 60117 +687
- Misses 15290 15936 +646
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Datasets are registered in DATASETS (reader, responses file, Request_AL key) instead of being handled in five places, so adding one is a single entry. - AIPerf's exports are read into one TurnResult per request turn instead of four parallel lists with different nesting. - bench.py checks once, before running AIPerf, that the server returns per-request spec-decode stats, instead of failing after a full run. - A failed temperature x concurrency point is reported and skipped; the rest of the sweep still runs and the script exits non-zero. - The launcher script reports progress while it waits for vllm serve, and the README says to point AIPERF_VENV at a shared directory. - The specdec_bench parity test also covers SPEED-Bench subsampling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: h-guo18 <67671475+h-guo18@users.noreply.github.com>
This branch has not been deployed
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.
What does this PR do?
Type of change: new example
Adds
examples/specdec_aiperf/, a standalone benchmark that measures the acceptance length and throughput of a speculative-decoding model served by vLLM, using AIPerf as the client. It neither imports nor changesexamples/specdec_bench. It follows specdec_bench's interface and output format, so the two can be compared.bench.pybenchmarks a running server once for every temperature × concurrency and writes specdec_bench's files to<save_dir>/t<T>_c<C>/:acceptance_rate.json:Average_AL,Category_AL,Request_AL, the histogram, and conditional and joint rates.timing.json:Output TPS,Output TPS/gpu, time to first token, per-request decode speed.*_responses.jsonl.configuration.json, includingcontainer_image, soupload_to_s3.pyaccepts the run.AIPerf's own exports stay in
aiperf/.Before the first run,
bench.pysends one short request and stops if the server returns no per-request spec-decode stats. A point that fails is reported and skipped, the rest of the sweep still runs, and the script exits non-zero.Datasets are MT-Bench and Spec-Bench JSONL, and SPEED-Bench splits prepared by specdec_bench's
prepare_data.py. Each dataset is one entry inDATASETS, giving its reader, responses file andRequest_ALkey.--num_requestsuses the same stratified selection as specdec_bench, so the prompts match.--runtime_paramstakes specdec_bench's runtime YAML (sampling_kwargs,chat_template_args).tools/launcher/common/specdec_aiperf/run.shstartsvllm serve $HF_MODEL_CKPTwith the args before--, adding--per-request-spec-decode-metrics summary, and runsbench.pywith the args after it. This is the same convention ascommon/vllm/query.sh.examples/Qwen/Qwen3-8B/specdec_aiperf_dflash.yamlis an example.Why. specdec_bench builds an in-process engine for every configuration. For an 816B target that is about 8 minutes of engine start per run, for a benchmark of about 2 minutes. A throughput-vs-concurrency curve also needed a separate
vllm bench serverun. Against one long-lived server, each additional temperature, concurrency or dataset costs only its benchmark time, and the same run reports acceptance length together with per-user and per-GPU throughput.How the numbers stay comparable with specdec_bench:
temperature,top_p,top_k) is sent explicitly. Otherwisevllm servefills unset fields from the model'sgeneration_config.json; for example, one target we tested setstop_k: 64.skip_special_tokens: false), as specdec_bench'stokenizer.decode()does.multi_turninput needs--num-conversations; otherwise AIPerf sends 10 requests, all first turns.HF_HUB_OFFLINEandTRANSFORMERS_OFFLINEbreak a local--tokenizerdirectory, so they are dropped for the AIPerf subprocess.Known differences:
vllm servepicks its own defaultmax_num_batched_tokens: 16384 on GB300, versus 2048 for specdec_bench's in-process engine. This changes the KV cache size, time to first token and throughput, but not acceptance length. The README says to set it when comparing throughput.tokenizer.eos_token, specdec_bench replays that stop token's text in turn 2 and this tool does not.Usage
Testing
Tool comparison on JHB. This used a hand-written harness and motivated this PR. Setup:
Arms, both on the same engine configuration with token-identical prompts:
vllm serve: 4 runs per temperature.Results:
This branch end to end on JHB.
common/specdec_aiperf/run.shran in the launcher's directory layout, but not throughslurm.py. Same target and drafter, and the server used the same engine settings as the comparison above. The script ran t=0/t=1 × concurrency 16/32 against one server:Average_ALThe server took the speculative config in the YAML's dotted form (
--speculative-config.method dflash ...), andmax_num_batched_tokenswas pinned to 2048 (KV cache 3.66M tokens, as in process). All 640 requests succeeded.upload_to_s3.py --dry-runaccepted the four result directories, andtiming.jsonmatches AIPerf's ownprofile_export_aiperf.json.How this compares with specdec_bench in process at concurrency 32:
The second commit (dataset registry, per-turn results, server preflight, sweep isolation) was run again the same way at concurrency 32:
Average_ALwas 3.840 at t=0 and 3.499 at t=1, within the spread of the runs above. The preflight check passed against the real server.Unit tests. Added
tests/examples/specdec_aiperf/test_bench.py, with three tests:bench.pyend to end with a stand-in foraiperf profile, including a failed point that leaves the rest of the sweep intact;MTBenchandTimingmetric classes on the same steps and timestamps, and its SPEED-Bench subsampling.Removing the failure isolation, the preflight check, or the stratified subsampling each makes one of these tests fail.
Not run:
vllm/vllm-openai:v0.29.0) on a cluster.tools/launcher/tests/test_examples_resolve.pypasses.Before your PR is "Ready for review"
CONTRIBUTING.md: ✅ AIPerf (Apache-2.0) is a dependency of this example only, installed in its own venv.Additional Information
Reopens #2973 as a draft. That PR changed
examples/specdec_benchitself; this version is standalone.🤖 Generated with Claude Code