Skip to main content
Benchmark TensorRT-LLM models for throughput and latency performance. Supports multiple backends (PyTorch, TensorRT, AutoDeploy) and various benchmarking modes.

Usage

Global Options

string
required
The HuggingFace name of the model to benchmark. Alias: -m
string
Path to a HuggingFace checkpoint directory for loading model components
string
default:"/tmp"
The directory to store benchmarking intermediate files. Alias: -w
string
default:"info"
The logging level. Choices: verbose, info, warning, error, internal_error
string
The revision to use for the HuggingFace model (branch name, tag name, or commit id)

Commands

throughput

Run a throughput benchmark to measure maximum request processing capacity.

Throughput Options

string
default:"pytorch"
Backend to use for benchmark. Choices: pytorch, tensorrt, _autodeploy
path
Path to a serialized TRT-LLM engine (for TensorRT backend)
path
required
Path to dataset file for benchmarking. Use prepare-dataset command to generate
integer
default:"0"
Number of requests to cap benchmark run at. If not specified or set to 0, it will be the length of dataset
integer
default:"2"
Number of requests to warm up benchmark
integer
Maximum runtime batch size to run the engine with
integer
Maximum runtime tokens that an engine can accept
integer
Maximum sequence length
integer
default:"1"
Number of search beams
float
default:"0.9"
The percentage of memory to use for KV Cache after model load
integer
default:"1"
Tensor parallelism size
integer
default:"1"
Pipeline parallelism size
integer
Expert parallelism size (for MoE models)
string
Path to a YAML file that overwrites the parameters. Can be specified as either --config or --extra_llm_api_options
path
Path to a YAML file that sets sampler options
boolean
default:"false"
Do not skip tokenizer initialization when loading the model (required for VLM models)
integer
default:"-1"
Set the end-of-sequence token for the benchmark. Set to -1 to disable EOS
string
Modality of the multimodal requests. Choices: image, video
string
default:"pt"
Format of the image data for multimodal models. Choices: pt, pil
string
default:"cuda"
Device to load the multimodal data on. Choices: cuda, cpu
integer
default:"4096"
Maximum input sequence length to use for multimodal models
integer
Target (average) input length for tuning heuristics
integer
Target (average) sequence length for tuning heuristics
path
Paths to custom module directories to import

latency

Run a latency benchmark to measure per-request response times.

Latency Options

string
default:"pytorch"
Backend to use for benchmark. Choices: pytorch, tensorrt, _autodeploy
path
Path to a serialized TRT-LLM engine
path
Path to dataset file for benchmarking
integer
default:"0"
Number of requests to cap benchmark run at. Minimum between value and length of dataset
integer
default:"2"
Number of requests to warm up benchmark
integer
default:"1"
Desired concurrency rate (number of requests processing at the same time), less than or equal to 0 for no concurrency limit
integer
default:"1"
Number of search beams
float
default:"0.9"
The percentage of memory to use for KV Cache after model load
integer
Maximum sequence length
integer
default:"1"
Tensor parallelism size
integer
default:"1"
Pipeline parallelism size
integer
Expert parallelism size
string
Path to a YAML file that overwrites the parameters
path
Path to a YAML file that sets sampler options
string
Modality of the multimodal requests. Choices: image, video
integer
default:"4096"
Maximum input sequence length to use for multimodal models
path
Path to a YAML file that defines the Medusa tree (for speculative decoding)
path
Path where report should be written to
path
Path where iteration logging is written to

prepare-dataset

Prepare a dataset for benchmarking.

build

Build a TensorRT engine for benchmarking.

Examples

Throughput Benchmark

Run a throughput benchmark with a prepared dataset:

Latency Benchmark

Measure single-request latency:

Multi-GPU Throughput

Benchmark with tensor parallelism:

TensorRT Engine Benchmark

Benchmark a pre-built TensorRT engine:

With Custom Configuration

Use a YAML configuration file:

Prepare Dataset

Generate a benchmark dataset:

High Concurrency Latency Test

Test latency under load:

Multimodal Benchmark

Benchmark a vision-language model: