Benchmark runtime
Overview
Measures how fast a trained model runs once it is exported, and compares the formats side by side. Give it a dataset of images and it times the whole pipeline per image - preprocess, model, postprocess (decode and NMS) - and reports the three stages separately, so you can see what share of the latency NMS takes. Without a dataset it times the forward pass alone on random input.
Point the node at the model, not at an export. It finds the exports that were created from that model, times each one on the GPU it is running on, and writes a report with latency, throughput, and the speedup between formats. The badge shows the throughput of the fastest format.
Prerequisites
How it works
Builds a fresh TensorRT engine from the ONNX export when a TensorRT export exists, so the engine matches the TensorRT version on this worker.
FAQ
Why did the run fail saying no export was found?
The model has no ONNX or TensorRT export yet. Run an Export node on it first, then benchmark.
Why does a TensorRT export alone not work?
A serialized TensorRT engine only loads on the exact TensorRT version that built it, and every export node builds with its own version. The benchmark rebuilds the engine from the ONNX export instead, so a model with a TensorRT export but no ONNX export fails with a message asking for the ONNX one.
Do the numbers include image loading, preprocessing and NMS?
With an images dataset, yes except for reading and decoding the files, which happens once before timing. Preprocess is the resize or letterbox, scaling and layout of a decoded image into the model’s input tensor (float16 for FP16 ONNX files). Model is the host-to-device copy, the forward pass and the copy of the outputs back. Postprocess is the confidence filter, plus decode and NMS when the graph has no NMS inside. Preprocess and postprocess run on the CPU in this node, so they measure that path and not a GPU-side one. Without a dataset only the forward pass is timed, on random input.
Why does the confidence threshold matter?
NMS cost grows with the number of boxes that clear the threshold. At 0.001, the value accuracy evaluation uses, thousands of weak boxes reach NMS; at 0.25 far fewer do. The report shows the mean number of boxes over the threshold and left after NMS next to each format. A graph exported with NMS inside applied the threshold it was exported with, and a DETR-style model (DEIM, EdgeCrafter) has no NMS at all.
Which models are read how?
A graph with a single output of shape batch by 4+classes by anchors is read as a raw YOLO head (decode, then class-aware NMS). A single output of shape batch by boxes by 6 is read as NMS already done; when the export recorded an nms flag on the file, that flag decides. The LibreYOLO export also records how its graph is read, and the node follows it: boxes as corners rather than centre and size, the image letterboxed to the top-left corner rather than centred, every class over the threshold as a candidate, the rows output of a graph with NMS inside (which also returns the raw head), and for LibreYOLO9E2E no NMS at all, only the top-scoring anchors over the threshold. Outputs named labels, boxes and scores are read as a DETR-style head, and the image is fed together with its original size. Other output layouts are timed without a postprocess stage.
Can I compare results measured on different machines?
Not directly. Latency and throughput depend on the GPU, the driver, and the library versions, all of which the report records for exactly this reason. Compare formats within one report, and rerun on the target hardware before trusting a cross-machine comparison.
When do I need to set Input Size?
Only when an export has dynamic spatial dimensions and the shape cannot be read from the model. Otherwise the shape comes from each exported model, which keeps the comparison honest across formats.
Where does the precision in the report come from?
From what the export node recorded when it built the file. When nothing was recorded, the runner reports the precision it detects from the model input and output types.
Is there a PyTorch baseline?
For YOLO models, on an images dataset, when the worker image has Ultralytics installed and the model has a PyTorch export (switch on the PyTorch format in the YOLO export node): that checkpoint is run through its own predict path in FP32 and its preprocess, inference and postprocess times are taken from the framework. For other frameworks, or without a dataset, there is no PyTorch row. With the instance’s safe-weights setting on, a PyTorch export is a pickle and is not opened, so there is no PyTorch row either; the ONNX and TensorRT rows still run. Speedups in the report are relative to the slowest benchmarked format.
Why does an FP16 ONNX file show a slower preprocess?
An FP16 ONNX graph takes float16 input, so the image tensor is converted to half precision on the CPU. That conversion is part of what a deployment of that file pays, and the preprocess stage shows it.
Why do repeated runs give slightly different numbers?
GPU clocks, thermal state, and other load on the card all move the result. Raise Measured Iterations for a steadier mean, and keep the card otherwise idle while benchmarking.
Inputs
Trained model to benchmark. Its ONNX and TensorRT exports are found automatically, so run an Export node on the model first. Key: MODEL.
Dataset whose images the formats are timed on, end to end per image - preprocess, model and postprocess (decode and NMS where the graph has none inside) are reported separately, as p50, p95 and mean. NMS time depends on how many boxes clear the confidence threshold, which only real images reproduce. Leave empty to time the forward pass alone on random input, as earlier versions did. Key: IMAGES.
How many images to take from the dataset, spread evenly over it. Each is downloaded and decoded once before timing starts, one timed pass runs over all of them. Ignored without an images dataset. Minimum: 1. Key: IMAGES_COUNT.
Images per inference call. 1 measures single-image latency, the deployment case of a camera or an API, a larger batch measures throughput. Latency is reported per image either way. A model exported with a fixed batch is timed at that batch. Minimum: 1. Key: BATCH_SIZE.
Boxes scoring below this are dropped in postprocess, and for a raw YOLO head it decides how many boxes reach NMS. 0.001 is what accuracy evaluation uses (it makes NMS the most expensive), 0.25 is the Ultralytics predict default. A graph exported with NMS inside already applied the threshold it was exported with, so a lower value here has no effect on it. Ignored without an images dataset. Minimum: 0. Maximum: 1. Step: 0.001. Key: CONF_THRESHOLD.
Overlap above which NMS suppresses a box, for a raw YOLO head. 0.7 is the Ultralytics default. DETR-style graphs (DEIM, EdgeCrafter) have no NMS and ignore it. Minimum: 0. Maximum: 1. Step: 0.01. Key: NMS_IOU.
Add a row for the ONNX export on the CPU provider, to see what a deployment without a GPU would get. The GPU formats are always measured. Key: ONNX_CPU.
Square input size in pixels, needed only for models with dynamic input dimensions. Leave empty to take the size from each export, a dynamic export falls back to 640 on an images dataset and to 224 on random input. Minimum: 1. Key: INPUT_SIZE.
Number of warmup inferences (discarded) run before timing, to let the GPU reach steady state. Minimum: 0. Key: WARMUP_ITERS.
Number of timed inferences used to compute mean / p95 latency and FPS. Minimum: 1. Key: MEASURE_ITERS.
Outputs
Asset ID containing the runtime benchmark report. Shown as an artifact. Key: REPORT_ID.
Throughput of the fastest benchmarked format, shown as a badge on the node. Shown on the node as a badge. Key: FPS.
Models and configuration
Exports are found through the link an Export node writes back to the model it converted, so you never select an export by hand. One export per format is benchmarked: ONNX Runtime on the GPU (and on the CPU when Also run ONNX Runtime on CPU is ticked), TensorRT, and a PyTorch baseline for YOLO.
The input shape is read from each exported model, which keeps every format on the same input. Warmup iterations are discarded so the GPU reaches steady state before timing starts. On random input, Measured iterations are the timed passes behind the mean and p95 latency; on an images dataset, one pass over the Number of images is timed and Measured iterations is not used. Batch size defaults to 1 and a model exported with a fixed batch is timed at that batch.
When the run finishes, the latency (mean, p50, p95), throughput, batch size, precision, GPU model and driver of each format are recorded on the model version in the registry, next to the scores its training reported; on images the per-stage milliseconds and the mean box counts are added. That makes speed a property of the model you can compare on later, not just a number in one report. Re-benchmarking a format replaces its numbers: they describe the GPU and the settings of that run.
Report
The report is attached to the node as an artifact and opens in the preview widget.
Overview carries four cards: the model and the formats that were benchmarked, the auto-detected hardware, the benchmark settings, and a plain-language result naming the fastest format with its latency and throughput.
Pipeline stages (images dataset only) lists, for every format, the p50 and p95 of preprocess, model and postprocess in milliseconds per image, the end-to-end mean, the share of it spent in postprocess, and the mean number of boxes over the confidence threshold and left after NMS.
Runtime Comparison is the part to read first. A table lists every format with its precision, mean and p95 latency, throughput, and speedup relative to the slowest benchmarked format, followed by a throughput bar chart. A scope note below the chart states what was covered, and points out the missing format when only one export was available.
Methodology records the environment (torch, ONNX Runtime, TensorRT, CUDA, and driver versions, plus the measurement timestamp) and explains how timing was done. Keep it in mind when comparing two reports: different versions mean different numbers.
Runtime
The node runs in its own container on a GPU worker and drives ONNX Runtime through the CUDA execution provider. If that provider fails to load, the run stops rather than silently falling back to CPU; the CPU row is a separate, explicit option.
Building the TensorRT engine happens inside the run and dominates the total time for larger models, so a benchmark that includes TensorRT takes considerably longer than an ONNX-only one.
The image carries TensorRT, NVIDIA software under NVIDIA’s license.
JSON config
Machine-readable node interface for automation and advanced usage.