Benchmark Inference
Measure throughput and latency of the Inference Server or the inference Python package with inference benchmark.
inference benchmark offers an easy way to check the performance of Inference in your setup. The command can benchmark both the Inference Server and the inference Python package.
inference benchmark --helpinference benchmark api-speed --helpBenchmarking the inference Python package
pip install inferenceA basic benchmark can be run using the following command:
inference benchmark python-package-speed \
-m {your_model_id} \
-d {pre-configured dataset name or path to directory with images} \
-o {output_directory}The command runs a specified number of inferences using the given model and saves statistics (including benchmark parameters, throughput, latency, errors, and platform details) in the given directory.
Benchmarking inference-models
inference benchmark inference-models-speed benchmarks the separately installed inference-models backend. The pending runtime-hardening build defaults to rejecting untrusted packages; pass --allow-untrusted-packages only when you deliberately trust their code.
Run inference benchmark inference-models-speed --help for model and dataset options. See Model Package Security for version scope and the separate server package settings.
Benchmarking the Inference Server
A basic benchmark can be run using the following command:
The command runs a specified number of inferences using the given model and saves statistics (including benchmark parameters, throughput, latency, errors, and platform details) in the given directory.
This benchmark has more configuration options to support different ways of HTTP API profiling. In default mode, a single client is spawned and it sends one request after another sequentially. This may be suboptimal in specific cases, so you may specify the number of concurrent clients using the -c {number_of_clients} option. Each client sends the next request once the previous one is handled.
This option still does not cover all test scenarios. For instance, you may want to send x requests each second, which is closer to a production environment where multiple clients send requests concurrently. In this scenario, the --rps {value} option can be used (and -c is ignored). The value provided in --rps specifies how many requests are spawned each second without waiting for previous requests to be handled. In I/O intensive benchmark scenarios, we suggest running the command from multiple separate processes and possibly multiple hosts.
See Inference Benchmarks for published results measured with this command.
Last updated
Was this helpful?