Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

Enable - disabling ORT optimizations flag in protopipe app (#27182)

Septimiu Neaga4d29e2ecc959
diff --git a/src/plugins/intel_npu/tools/protopipe/README.md b/src/plugins/intel_npu/tools/protopipe/README.md
index afe6e8cffbc..00849ad8bdd 100644
--- a/src/plugins/intel_npu/tools/protopipe/README.md
+++ b/src/plugins/intel_npu/tools/protopipe/README.md
@@ -97,6 +97,7 @@ The dependency graph in Protopipe is specified by:
- `tag` - **Required**. The unique name of operation.
- `type` - **Optional**. The operation type: _Infer_, _CPU_, _Compound_ (**Default**: _Infer_)
- `repeat_count` - **Optional**. Runs operation over specified number of iterations.
+ - `opt_level` - **Optional**. Configures optimization level for ONNX Runtime.
- `connections` - The list of connections between operations.
Supported operation types
diff --git a/src/plugins/intel_npu/tools/protopipe/src/parser/config.cpp b/src/plugins/intel_npu/tools/protopipe/src/parser/config.cpp
index 34099d36a69..c2a1bd6415d 100644
--- a/src/plugins/intel_npu/tools/protopipe/src/parser/config.cpp
+++ b/src/plugins/intel_npu/tools/protopipe/src/parser/config.cpp
@@ -404,6 +404,9 @@ struct convert<ONNXRTParams> {
if (node["ep"]) {
params.ep = node["ep"].as<ONNXRTParams::EP>();
}
+ if (node["opt_level"]) {
+ params.opt_level = node["opt_level"].as<int>();
+ }
return true;
}
};
diff --git a/src/plugins/intel_npu/tools/protopipe/src/scenario/inference.hpp b/src/plugins/intel_npu/tools/protopipe/src/scenario/inference.hpp
index c4fd85aa267..e4568c67143 100644
--- a/src/plugins/intel_npu/tools/protopipe/src/scenario/inference.hpp
+++ b/src/plugins/intel_npu/tools/protopipe/src/scenario/inference.hpp
@@ -104,6 +104,7 @@ struct ONNXRTParams {
};
// NB: std::monostate stands for the default MLAS Execution provider
using EP = std::variant<std::monostate, OpenVINO>;
+ std::optional<int> opt_level;
EP ep;
};
diff --git a/src/plugins/intel_npu/tools/protopipe/src/simulation/simulation.cpp b/src/plugins/intel_npu/tools/protopipe/src/simulation/simulation.cpp
index 52f57c2881a..5b1743651b6 100644
--- a/src/plugins/intel_npu/tools/protopipe/src/simulation/simulation.cpp
+++ b/src/plugins/intel_npu/tools/protopipe/src/simulation/simulation.cpp
@@ -79,6 +79,9 @@ static void cfgExecutionProvider(cv::gapi::onnx::Params<cv::gapi::Generic>& netw
static cv::gapi::GNetPackage getNetPackage(const std::string& tag, const ONNXRTParams& params) {
cv::gapi::onnx::Params<cv::gapi::Generic> network{tag, params.model_path};
network.cfgSessionOptions(params.session_options);
+ if (params.opt_level.has_value()) {
+ network.cfgOptLevel(params.opt_level.value());
+ }
cfgExecutionProvider(network, params.ep);
return cv::gapi::networks(network);
}