From 4fbc08e3c28ee20bfbb06aceb0e00d6f635535c3 Mon Sep 17 00:00:00 2001 From: sfatimar Date: Sun, 30 Apr 2023 04:18:34 +0530 Subject: [PATCH] VPUX config fix and dynamic_shape bug fixed. (#15737) Dynamic shapes was not working with serialized model so we are switching to compile model method ### Motivation and Context Dynamic shapes was not working with serialized model - If it fixes an open issue, please link to the issue here. --> Signed-off-by: MaajidKhan Co-authored-by: MaajidKhan --- .../core/providers/openvino/backends/basic_backend.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/openvino/backends/basic_backend.cc b/onnxruntime/core/providers/openvino/backends/basic_backend.cc index b0749916a7..9bdbdbad59 100644 --- a/onnxruntime/core/providers/openvino/backends/basic_backend.cc +++ b/onnxruntime/core/providers/openvino/backends/basic_backend.cc @@ -73,7 +73,7 @@ BasicBackend::BasicBackend(const ONNX_NAMESPACE::ModelProto& model_proto, #endif #else #if defined(OPENVINO_2023_0) - if (subgraph_context.precision != InferenceEngine::Precision::FP16) { + if (subgraph_context.precision != InferenceEngine::Precision::FP16 && global_context_.enable_dynamic_shapes == false) { const std::string model = model_proto.SerializeAsString(); exe_network_ = global_context_.ie_core.LoadNetwork(model, hw_target, device_config, subgraph_context_.subgraph_name); LOGS_DEFAULT(INFO) << log_tag << "Loaded model to the plugin"; @@ -131,6 +131,13 @@ BasicBackend::BasicBackend(const ONNX_NAMESPACE::ModelProto& model_proto, if (openvino_ep::backend_utils::IsDebugEnabled()) { device_config.emplace(ov::enable_profiling(true)); } +#endif +#if defined(OPENVINO_2023_0) + if (global_context_.device_type.find("VPUX") != std::string::npos) { + std::pair device_property; + device_property = std::make_pair("VPUX_COMPILER_TYPE", "MLIR"); + device_config.emplace(ov::device::properties("VPUX", device_property)); + } #endif }