The profiler captures timing data for the preprocess, inference, and postprocess stages of the pipeline. When the pipeline concludes, the profiling results are written to a JSON file with the following structure:
General Metrics:
backend: The inference backend runtime used (for example,
"onnxruntime:vitisai-ep","vart").duration_sec: Total duration of the pipeline execution in seconds.
frames: Total number of frames processed.
fps_avg: Average frames per second (FPS) achieved during execution.
Per-Stage Metrics:
For each stage (preprocess, inference, postprocess), the following timing information is captured:
init_us: Initialization time for the stage in microseconds.
deinit_us: De-initialization time for the stage in microseconds.
avg_us: Average execution time per frame in microseconds.
min_us: Minimum execution time observed in microseconds.
max_us: Maximum execution time observed in microseconds.
samples: Number of samples (frames) processed in this stage.
Sample Profiler Output:
{
"backend": "onnxruntime:vitisai-ep",
"duration_sec": "8.250",
"frames": 1062,
"fps_avg": "128.721",
"preprocess": {
"init_us": 26431,
"deinit_us": 239,
"avg_us": 350,
"min_us": 345,
"max_us": 697,
"samples": 1066
},
"inference": {
"init_us": 1596981,
"deinit_us": 2,
"avg_us": 7641,
"min_us": 7597,
"max_us": 8140,
"samples": 1063
},
"postprocess": {
"init_us": 79,
"deinit_us": 147,
"avg_us": 74,
"min_us": 67,
"max_us": 146,
"samples": 1062
}
}
This profiling data helps identify performance bottlenecks across different stages of the inference pipeline, enabling optimization and performance tuning.