What 13 Milliseconds Buys You
We changed one setting, the floating-point format a detection model runs in; on a service already deployed to a Jetson board, and cut its latency in half. Here's the full accounting: what FP16 actually costs, what it doesn't, and exactly where the savings run out.
The service in question detects a set of product-condition classes on a live line, using a YOLOv8-style model exported to ONNX and served behind a FastAPI endpoint. It runs on an NVIDIA Jetson (JetPack 6.2, Ampere-class GPU, compute capability sm87), with ONNX Runtime auto-selecting the fastest execution provider it can find: TensorRT, then CUDA, then plain CPU.
The input is fixed at 1×3×640×640 fully static shapes, letterboxed and normalized. That determinism is what makes precision a fair lever to pull: same model, same hardware, same input, one flag changed.
The question we actually needed answered wasn't “is FP16 faster.” It's always faster. The question was how much, in a real served pipeline rather than a synthetic benchmark and whether the gain was still worth having once every other cost in the request path was counted too.
Measured on the same Jetson, warmed up, same model

What 13ms actually buys you
Dropping from FP32 to FP16 took inference from 37ms to 13ms nearly a 3× cut and, more importantly, took the whole pipeline from 58ms to 27ms, better than 2×. That second number is the one that matters, because it's the one that sets how fast the line can actually run.
Invert it, and it's a throughput budget: 58ms caps this board at roughly 17 frames a second; 27ms raises that ceiling to about 37. On an inspection line, that's the difference between the model keeping pace with the camera and the camera queuing up behind it.
And FP16 was close to free to get. No calibration set, no retraining, no accuracy audit, just an export flag and a runtime setting. That's what put it first in the optimization order, ahead of INT8, which needs a representative calibration set (500–1,000 images spanning all classes) and a follow-up mAP check, and which can quietly cost recall on the smaller objects in a frame. FP16 was the obvious move. INT8 is still an open, harder decision.
Where the savings stop
The honest part of this story is the third row in the table. trtexec, NVIDIA's own benchmarking tool, ran the identical FP16 engine, on the identical board, and reported 3.7ms. Not 13. The GPU itself is doing this in well under a third of what the service reports.
trtexec --onnx=model.onnx --saveEngine=model.engine --fp16The missing ~9ms isn't compute, it's the cost of a Python process sitting between the camera and the GPU: host-to-device and device-to-host transfers, the GIL, a synchronous stream.synchronize() on every single call. We confirmed this the hard way: bypassing ONNX Runtime entirely and calling the TensorRT Python API directly produced the identical ~13ms. Swapping which library holds the Python interpreter changed nothing, because the interpreter was never the fast part to begin with.
The floor for this model, on this hardware, is about 13ms whether Python is talking to ONNX Runtime or straight to TensorRT. Precision buys you the gap between 37ms and 13ms. It does not buy you the gap between 13ms and 3.7ms that one belongs to the serving stack.
What's still on the table
The 14ms sitting between inference (13ms) and total (27ms) on the FP16 row is preprocessing and post-processing, and it's the next place we're looking:
GPU-side letterboxing. Resize and normalize currently run in Python at roughly 9ms comparable to inference itself, and a poor trade for CPU cycles that could stay idle.
Fused NMS. Non-max suppression runs as a NumPy pass after the forward pass today. Re-exporting with nms=True would let it run on-GPU as an EfficientNMS_TRT plugin, removing a round trip entirely.
The checklist, if you're doing this yourself
Time the whole request, not just the forward pass. A timer wrapped only around session.run() hid the real cost on this exact service before we re-instrumented it.
Confirm the provider that actually loaded. A silent fallback to CPUExecutionProvider is the single most common reason a “GPU” deployment is slow, check it at runtime, don't assume it from the image name.
Reach for FP16 before INT8. It costs an export flag; INT8 costs a calibration set and an accuracy re-check.
Measure your floor with a native tool. trtexec (or equivalent) tells you how much latency is precision and compute, and how much is everything wrapped around it, two very different problems with two different fixes.


Comments