vllm.benchmarks.throughput
¶
Benchmark offline inference throughput.
Functions:
-
assign_loras–Attach a LoRA request to each sample (throughput-only post-processing).
-
run_vllm_chat–Run vLLM chat benchmark. This function is recommended ONLY for benchmarking
-
validate_args–Validate command-line arguments.
_to_serve_args(args)
¶
Translate throughput args into a namespace the shared get_samples reads.
get_samples (used by bench serve) expects ~45 attributes; the
throughput CLI exposes most of them under the same names, and this adapter
fills the rest while preserving throughput's existing flag names so no
script breaks.
Parameters:
Returns:
-
Namespace–A namespace satisfying get_samples's attribute reads.
assign_loras(requests, args)
¶
Attach a LoRA request to each sample (throughput-only post-processing).
The shared datasets.get_samples path carries no LoRA information, so
LoRA assignment is applied here, uniformly across every dataset type. No-op
when --lora-path is unset.
run_vllm_chat(requests, n, engine_args, do_profile, disable_detokenize=False, warmup_requests=None, prequeue_requests=False)
¶
Run vLLM chat benchmark. This function is recommended ONLY for benchmarking multimodal models as it properly handles multimodal inputs and chat formatting. For non-multimodal models, use run_vllm() instead.
validate_args(args)
¶
Validate command-line arguments.