翻篇收录说明
翻篇网页快照

Benchmark CLI - vLLM

https://docs.vllm.ai/en/latest/benchmarking/cli/

最近抓取:2026-12-03 12:19:18(北京时间)

最近内容变化:2026-12-03 12:19:18(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

正文摘录

Benchmark CLI¶ This section guides you through running benchmark tests with the extensive datasets supported on vLLM. It's a living document, updated as new features and datasets become available. Tip The benchmarks described on this page are mainly for evaluating specific vLLM features as well as regression testing. For benchmarking production vLLM servers, we recommend GuideLLM, an established performance benchmarking framework with live progress updates and automatic report generation. It is also more flexible than vllm bench serve in terms of dataset loading, request formatting, and workload patterns. Model Forward Benchmark¶ For exact-batch model timing, including steady-state pipeline-parallel forwards, see vllm bench forward. For skewed synthetic MoE expert loads, use --routing zipf: vllm bench forward --model Qwen/Qwen3-30B-A3B \ --routing zipf --case decode=6*1@8192 --case prefill=2048 Each token independently selects distinct experts without replacement, weighted by popularity rank to the power of -1.25. Expert popularity is randomly permuted per layer to avoid systematically assigning hot experts to the lowest EP ranks. The fixture is seeded by --seed, fixed across timing replays, and generated outside the timed forward. Sequence-parallel TP ranks use their corresponding token rows. When replacing expert IDs, both synthetic modes preserve inactive -1 slots and leave routing weights unchanged, so padded rows remain unrouted. The expert-ID hook performs this mask selection inside the timed forward; the gate-logits hook relies on the model's downstream padding mask. Zipf allows EP load imbalance; --routing balanced gives equal load per EP rank. Neither synthetic mode supports grouped top-k routing; Zipf also does not support prefill context parallelism. The default --routing auto selects Zipf with dummy weights and real routing otherwise. When the model or parallel layout does not support the synthetic fixture, auto warns and falls back to real routing. Use --routing balanced to explicitly request equal EP load. Zipf is a synthetic workload, not a fit to a particular model's routing or speculative-token correlations. The standard forward benchmark captures an exact-shape, one-shot graph with the runner's CUDA graph manager disabled. It does not add serving capture-bucket padding; model-level padding, such as sequence-parallel alignment, can still occur. Use native serving graphs when evaluating capture-bucket padding costs. Attention Kernel Benchmark¶ Run the attention kernel smoke benchmark from the repository root using the exact backend names: python3 benchmarks/attention_benchmarks/benchmark.py \ --backends FLASH_ATTN FLASHINFER --batch-specs "8q1s1k" If any configuration fails, the benchmark exits with status 1 after reporting results and writing any requested CSV or JSON output. Successful runs exit with status 0. Profiling runs also propagate failures, but do not save timing metrics. Sparse MLA benchmarks use the metadata builder's prefill route by default. The mha_vs_mqa comparison mode forces the selected dense_mha, masked_mha, and mqa variants. When calling the benchmark runner from Python, set BenchmarkConfig.sparse_mla_route to SparseMLAPrefillRoute.DENSE_MHA, MASKED_MHA, or SPARSE_MQA to force a route, or leave it as None to use the builder's decision. Import SparseMLAPrefillRoute from vllm.v1.attention.backends.mla.sparse_utils. This replaces the benchmark-only sparse_mla_force_mqa and sparse_mla_mha_mode fields. The runner's FP8 options output_scale and fuse_quant_op are keyword-only; old positional route overrides raise TypeError instead of being interpreted as quantization options. Move route overrides into BenchmarkConfig. BenchmarkResult.actual_sparse_mla_route records the executed prefill route (or SPARSE_MQA for decode-only sparse batches). The result table shows this route below each timing; JSON and CSV include its enum name in actual_sparse_mla_route. Decodes in mixed batches always use MQA. If automatic routing chooses MQA despite an explicit prefill_backend, the runner warns that the requested prefill backend was not executed. Set the route enum explicitly when measuring an MHA kernel. The YAML prefill_backends comparison explicitly measures MHA. For sparse MLA, it uses dense MHA when every sequence fits within the benchmark's top-k of 2048, and masked MHA otherwise. Masked MHA requires fa4. Unsupported prefill backends report an error instead of falling back to sparse MQA and labeling its timing as the requested backend. FP8 output comparisons also require an MHA prefill route; an automatic sparse MQA route reports an error instead of silently omitting output quantization. Dataset Overview¶ Dataset Online Offline Data Path ShareGPT ✅ ✅ wget https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json ShareGPT4V (Image) ✅ ✅ wget https://huggingface.co/datasets/Lin-Chen/ShareGPT4V/resolve/main/sharegpt4v_instruct_gpt4-vision_cap100k.jsonNote that the images need to be downloaded separately. For example, to download COCO's 2017 Train images:wget http://images.cocodataset.org/zips/train2017.zip ShareGPT4Video (Video) ✅ ✅ git clone https://huggingface.co/datasets/ShareGPT4Video/ShareGPT4Video BurstGPT ✅ ✅ wget https://github.com/HPMLL/BurstGPT/releases/download/v1.1/BurstGPT_without_fails_2.csv Random ✅ ✅ synthetic RandomMultiModal (Image/Video) ✅ ✅ synthetic RandomForReranking ✅ ✅ synthetic Prefix Repetition ✅ ✅ synthetic HuggingFace-VisionArena ✅ ✅ lmarena-ai/VisionArena-Chat HuggingFace-MMVU ✅ ✅ yale-nlp/MMVU HuggingFace-InstructCoder ✅ ✅ likaixin/InstructCoder HuggingFace-AIMO ✅ ✅ AI-MO/aimo-validation-aime, AI-MO/NuminaMath-1.5, AI-MO/NuminaMath-CoT HuggingFace-Other ✅ ✅ lmms-lab/LLaVA-OneVision-Data, Aeala/ShareGPT_Vicuna_unfiltered HuggingFace-MTBench ✅ ✅ philschmid/mt-bench HuggingFace-HumanEval ✅ ✅ openai/openai_humaneval HuggingFace-GSM8K ✅ ✅ openai/gsm8k HuggingFace-Blazedit ✅ ✅ vdaita/edit_5k_char, vdaita/edit_10k_char HuggingFace-ASR ✅ ✅ openslr/librispeech_asr, facebook/voxpopuli, LIUM/tedlium, edinburghcstr/ami, speechcolab/gigaspeech, kensho/spgispeech, ArtificialAnalysis/Earnings22-Cleaned-AA, D4nt3/esb-datasets-earnings22-validation-tiny-filtered Spec Bench ✅ ✅ wget https://raw.githubusercontent.com/hemingkx/Spec-Bench/refs/heads/main/data/spec_bench/question.jsonl SPEED-Bench ✅ ✅ curl -LsSf https://raw.githubusercontent.com/NVIDIA-NeMo/Gym/refs/heads/main/benchmarks/speed-bench/prepare.py \| python3 - --format raw Custom ✅ ✅ Local file: data.jsonl Custom Audio ✅ ✅ Local file: audio_data.jsonl Custom Image ✅ ✅ Local file: image_data.jsonl Legend: ✅ - supported 🟡 - Partial support 🚧 - to be supported Note HuggingFace dataset's dataset-name should be set to hf. For local dataset-path, please set hf-name to its Hugging Face ID like --dataset-path /datasets/VisionArena-Chat/ --hf-name lmarena-ai/VisionArena-Chat Examples¶ 🚀 Online Benchmark¶ Show more First start serving your model: vllm serve NousResearch/Hermes-3-Llama-3.1-8B Then run the benchmarking script: # download dataset # wget https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json vllm bench serve \ --backend vllm \ --model NousResearch/Hermes-3-Llama-3.1-8B \ --endpoint /v1/completions \ --dataset-name sharegpt \ --dataset-path <your data path>/ShareGPT_V3_unfiltered_cleaned_split.json \ --num-prompts 10 If successful, you will see the following output: ============ Serving Benchmark Result ============ Successful requests: 10 Benchmark duration (s): 5.78 Total input tokens: 1369 Total generated tokens: 2212 Request throughput (req/s): 1.73 Output token throughput (tok/s): 382.89 Peak output token throughput (tok/s): 512.00 Total token throughput (tok/s): 619.85 ---------------Time to First Token---------------- Mean TTFT (ms): 71.54 Median TTFT (ms): 73.88 P99 TTFT (ms): 79.49 -----Time per Output Token (excl. 1st token)------ Mean TPOT (ms): 7.91 Median TPOT (ms): 7.96 P99 TPOT (ms): 8.03 ---------------Inter-token Latency---------------- Mean ITL (ms): 7.74 Median ITL (ms): 7.70 P99 ITL (ms): 8.39 ================================================== Warning Repeating vllm bench serve against the same server can reuse prompts left in the prefix cache and inflate throughput. This can affect any reproducible dataset; the synthetic random dataset is reproducible for a fixed --seed, which defaults to 0. Prefix cache hits can also come from shared prefixes within the run, so interpret cache metrics in the context of the workload. If cache reuse is not intended, vary --seed, reset or restart the server, or use vllm bench sweep serve, which resets server caches between runs. Understanding the Latency Metrics¶ vllm bench serve measures latency at the benchmark client: Note Metric terminology is not standardized across benchmarking tools. When comparing results, use the measurement points and formulas rather than the metric names alone. This section explains how we refer to them in vLLM. Time to first token (TTFT) is the time from sending a request to receiving its first streamed output. Inter-token latency (ITL) records the time between consecutive streamed outputs. The reported ITL statistics aggregate these individual gaps across all successful requests. Time per output token (TPOT) is calculated once per request, excluding the first token, and then aggregated across requests: \[ \text{TPOT} = \frac{\text{end-to-end latency} - \text{TTFT}} {\text{number of output tokens} - 1} \] With standard decoding, each streamed output usually contains one token, so ITL and TPOT are typically similar. With speculative decoding, one streamed output can contain multiple tokens, such as several accepted draft tokens within a single engine step. ITL records only the gaps between streamed outputs; it does not add zero-duration gaps for tokens in the same output. TPOT instead amortizes the