Skip to content

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

[Protopipe] Reshape support for ONNXRT backend (#34534)

Andrei Tamas19562637c898
diff --git a/src/plugins/intel_npu/tools/protopipe/README.md b/src/plugins/intel_npu/tools/protopipe/README.md
index 858be5ef382..8ccceec2578 100644
--- a/src/plugins/intel_npu/tools/protopipe/README.md
+++ b/src/plugins/intel_npu/tools/protopipe/README.md
@@ -50,6 +50,7 @@ log_level: INFO
- `name` or `path` - **Required**. Path to the model file.
- `framework` - **Optional**. Framework to use for inference: *onnxrt*, *openvino*. (**Default**: *openvino*)
- `input_data`, `output_data`, `metric`, `random` - **Optional**. Follow [Use-cases](#use-cases) to learn the details.
+- `reshape` - **Optional**. Set shape for input layers. For example, "input1: [1,3,224,224], input2: [1,4]" or "[1,3,224,224]" in case of one input layer.
#### OpenVINO parameters
- `priority` - **Optional**. Model priority: _HIGH_, _MEDIUM_, _LOW_. (Default: _MEDIUM_)
- `config` - **Optional**. OpenVINO Plugin specific parameters.
@@ -60,7 +61,6 @@ log_level: INFO
- `ol` - **Optional**. Output layer layout.
- `iml` - **Optional**. Input model layout.
- `oml` - **Optional**. Output model layout.
-- `reshape` - **Optional**. Set shape for input layers. For example, "input1: [1,3,224,224], input2: [1,4]" or "[1,3,224,224]" in case of one input layer.
- `clamp_outputs` - **Optional**. Clamps all model outputs to the valid range for their precision. Requires `op` to be set for it to take effect.
Examples:
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 7f7814693df..1d2073ddf73 100644
--- a/src/plugins/intel_npu/tools/protopipe/src/parser/config.cpp
+++ b/src/plugins/intel_npu/tools/protopipe/src/parser/config.cpp
@@ -1,4 +1,3 @@
-//
// Copyright (C) 2018-2026 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
@@ -432,6 +431,9 @@ struct convert<ONNXRTParams> {
if (node["opt_level"]) {
params.opt_level = node["opt_level"].as<int>();
}
+ if (node["reshape"]) {
+ params.reshape = node["reshape"].as<LayerVariantAttr<std::vector<size_t>>>();
+ }
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 514665199d1..5dc8f687062 100644
--- a/src/plugins/intel_npu/tools/protopipe/src/scenario/inference.hpp
+++ b/src/plugins/intel_npu/tools/protopipe/src/scenario/inference.hpp
@@ -1,4 +1,3 @@
-//
// Copyright (C) 2018-2026 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
@@ -108,6 +107,8 @@ struct ONNXRTParams {
using EP = std::variant<std::monostate, OpenVINO>;
std::optional<int> opt_level;
EP ep;
+
+ LayerVariantAttr<std::vector<size_t>> reshape;
};
using InferenceParams = std::variant<std::monostate, OpenVINOParams, ONNXRTParams>;
diff --git a/src/plugins/intel_npu/tools/protopipe/src/simulation/layers_reader.cpp b/src/plugins/intel_npu/tools/protopipe/src/simulation/layers_reader.cpp
index 73715a7d0d9..8f9a2b387a2 100644
--- a/src/plugins/intel_npu/tools/protopipe/src/simulation/layers_reader.cpp
+++ b/src/plugins/intel_npu/tools/protopipe/src/simulation/layers_reader.cpp
@@ -1,4 +1,3 @@
-//
// Copyright (C) 2018-2026 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
@@ -42,5 +41,7 @@ InOutLayers LayersReader::readLayers(const InferenceParams& params) {
// NB: Using OpenVINO to read the i/o layers information for *.onnx model
OpenVINOParams ov;
ov.path = OpenVINOParams::ModelPath{ort.model_path, ""};
+ // NB: Pass reshape info to handle models with dynamic shapes
+ ov.reshape = ort.reshape;
return getOVReader().readLayers(ov, true /* use_results_names */);
}
diff --git a/src/plugins/intel_npu/tools/protopipe/version.hpp.in b/src/plugins/intel_npu/tools/protopipe/version.hpp.in
index 98b5b4e0070..38302c11c43 100644
--- a/src/plugins/intel_npu/tools/protopipe/version.hpp.in
+++ b/src/plugins/intel_npu/tools/protopipe/version.hpp.in
@@ -1,3 +1,3 @@
#pragma once
-#define APP_VERSION "v1.2.2-@GIT_SHA@"
+#define APP_VERSION "v1.2.3-@GIT_SHA@"