You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds model compilation support in ort perf test
* Add `--compile_ep_context` flag in onnxruntime_perf_test. This
generates EP context model and prints out compilation time and perf
statistics for the compiled model
* Prints `Compile time cost` for EP context compilation
Sample usage:
```sh
$ ./onnxruntime_perf_test -e trt-rtx -I -r 1 "/path/to/model.onnx" --compile_ep_context --compile_model_path "/path/to/model_ctx.onnx"
```
Output:
```sh
Compile time cost: 17.8012 s
Session creation time cost: 0.966619 s
First inference time cost: 8151 ms
Total inference time cost: 8.08084 s
Total inference requests: 1
Average inference time cost: 8080.84 ms
Total inference run time: 8.08085 s
Number of inferences per second: 0.123749
Avg CPU usage: 6 %
Peak working set size: 7861874688 bytes
Avg CPU usage:6
Peak working set size:7861874688
Runs:1
Min Latency: 8.08084 s
Max Latency: 8.08084 s
P50 Latency: 8.08084 s
P90 Latency: 8.08084 s
P95 Latency: 8.08084 s
P99 Latency: 8.08084 s
P999 Latency: 8.08084 s
```
ABSL_FLAG(bool, list_ep_devices, false, "Prints all available device indices and their properties (including metadata). This option makes the program exit early without performing inference.\n");
173
173
ABSL_FLAG(std::string, select_ep_devices, "", "Specifies a semicolon-separated list of device indices to add to the session and run with.");
174
+
ABSL_FLAG(bool, compile_ep_context, DefaultPerformanceTestConfig().run_config.compile_ep_context, "Generate an EP context model");
175
+
ABSL_FLAG(std::string, compile_model_path, "model_ctx.onnx", "The compiled model path for saving EP context model. Overwrites if already exists");
176
+
ABSL_FLAG(bool, compile_binary_embed, DefaultPerformanceTestConfig().run_config.compile_binary_embed, "Embed binary blob within EP context node");
174
177
ABSL_FLAG(bool, h, false, "Print program usage.");
175
178
176
179
namespaceonnxruntime {
@@ -487,6 +490,16 @@ bool CommandLineParser::ParseArguments(PerformanceTestConfig& test_config, int a
487
490
if (!select_ep_devices.empty()) test_config.selected_ep_device_indices = select_ep_devices;
0 commit comments