TensorRT EP produces incorrect results with CUDA I/O Binding when input is populated asynchronously without an explicit stream dependency
We found a reproducible correctness issue when using ONNX Runtime TensorRT EP with CUDA I/O Binding.
The TensorRT engine itself is correct. The issue occurs when a CUDA-bound input buffer is populated asynchronously by external CUDA work and TensorRT EP consumes that buffer without an explicit CUDA stream happens-before relationship.
The same model and input produce correct results through:
ORT CPU
ORT CUDA
native TensorRT 10.13.3.9
an ORT-generated TensorRT engine executed directly with
trtexecORT TensorRT EP with host input
ORT TensorRT EP with CUDA device input after explicit synchronization
The incorrect results occur only when the CUDA input buffer is populated asynchronously and inference starts without explicitly synchronizing the producer CUDA stream.
We initially suspected the D-FINE model, TF32, GridSample/deformable attention, TensorRT graph compilation, and TensorRT engine generation. Those possibilities were isolated and excluded.
Using the public D-FINE-M ONNX artifact from dfine-cpp v0.5.0, we observed the following over 32 images / 1,600 Top-50 detections:
For native TensorRT:
Minimum IoU:
0.999568Mean IoU:
0.999995
For the final device-resident path after explicit synchronization:
1,600 / 1,600 matching detections
Source: microsoft/onnxruntime