From fa667156cb4d3622de404f67a167ecd4bb91b5ce Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Thu, 14 Sep 2023 15:11:26 +0400 Subject: [PATCH] Check HolderTests under the proxy (#19785) * Skip only virtual device tests * Fixed proxy life time * Fixed compiled model get property * Fixed code style * Try to fix LTO --- src/core/include/openvino/core/any.hpp | 6 +++++ src/inference/src/compiled_model.cpp | 24 ++++++++++++------- .../skip_tests_config.cpp | 4 +++- src/plugins/proxy/src/compiled_model.hpp | 5 +++- src/plugins/proxy/src/infer_request.cpp | 4 ++++ 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/core/include/openvino/core/any.hpp b/src/core/include/openvino/core/any.hpp index f27e223bf7f..622013b2b1f 100644 --- a/src/core/include/openvino/core/any.hpp +++ b/src/core/include/openvino/core/any.hpp @@ -370,6 +370,11 @@ class Node; class RuntimeAttribute; class CompiledModel; +namespace proxy { + +class CompiledModel; + +} class RemoteContext; class RemoteTensor; @@ -659,6 +664,7 @@ class OPENVINO_API Any { friend class ::ov::RuntimeAttribute; friend class ::InferenceEngine::ExecutableNetwork; friend class ::ov::CompiledModel; + friend class ::ov::proxy::CompiledModel; friend class ::ov::RemoteContext; friend class ::ov::RemoteTensor; friend class ::ov::Plugin; diff --git a/src/inference/src/compiled_model.cpp b/src/inference/src/compiled_model.cpp index c51f5402ef4..a3c9f2ccdb3 100644 --- a/src/inference/src/compiled_model.cpp +++ b/src/inference/src/compiled_model.cpp @@ -8,14 +8,15 @@ #include "openvino/runtime/icompiled_model.hpp" #include "openvino/runtime/properties.hpp" -#define OV_COMPILED_MODEL_CALL_STATEMENT(...) \ - OPENVINO_ASSERT(_impl != nullptr, "CompiledModel was not initialized."); \ - try { \ - __VA_ARGS__; \ - } catch (const std::exception& ex) { \ - OPENVINO_THROW(ex.what()); \ - } catch (...) { \ - OPENVINO_THROW("Unexpected exception"); \ +#define OV_COMPILED_MODEL_CALL_STATEMENT(...) \ + if (_impl == nullptr) \ + OPENVINO_THROW("CompiledModel was not initialized."); \ + try { \ + __VA_ARGS__; \ + } catch (const std::exception& ex) { \ + OPENVINO_THROW(ex.what()); \ + } catch (...) { \ + OPENVINO_THROW("Unexpected exception"); \ } namespace ov { @@ -115,7 +116,12 @@ void CompiledModel::set_property(const AnyMap& config) { } Any CompiledModel::get_property(const std::string& name) const { - OV_COMPILED_MODEL_CALL_STATEMENT(return {_impl->get_property(name), {_so}}); + OV_COMPILED_MODEL_CALL_STATEMENT({ + auto property = _impl->get_property(name); + if (!property._so) + property._so = _so; + return property; + }); } RemoteContext CompiledModel::get_context() const { diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp index ef9e93a3f4f..c4a71cdddd6 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp @@ -129,6 +129,8 @@ std::vector disabledTestPatterns() { R"(.*MemoryDynamicBatch.*)", // Meta plugins may miss saving HW plugin so handle, thus plugin may be unloaded before all objects are deleted which leads to segfault // Issue: 118840 - R"(.*OVHoldersTest.*)", + R"(.*OVHoldersTest.*AUTO.*)", + R"(.*OVHoldersTest.*MULTI.*)", + R"(.*OVHoldersTest.*BATCH.*)", }; } diff --git a/src/plugins/proxy/src/compiled_model.hpp b/src/plugins/proxy/src/compiled_model.hpp index 650852b066e..ee6e1062156 100644 --- a/src/plugins/proxy/src/compiled_model.hpp +++ b/src/plugins/proxy/src/compiled_model.hpp @@ -38,7 +38,10 @@ public: } ov::Any get_property(const std::string& name) const override { - return m_compiled_model->get_property(name); + auto property = m_compiled_model->get_property(name); + if (!property._so) + property._so = m_compiled_model._so; + return property; } const std::vector>& inputs() const override { return m_compiled_model->inputs(); diff --git a/src/plugins/proxy/src/infer_request.cpp b/src/plugins/proxy/src/infer_request.cpp index affa877bb0b..81cc7adf970 100644 --- a/src/plugins/proxy/src/infer_request.cpp +++ b/src/plugins/proxy/src/infer_request.cpp @@ -49,6 +49,8 @@ std::vector ov::proxy::InferRequest::get_profiling_info() con ov::SoPtr ov::proxy::InferRequest::get_tensor(const ov::Output& port) const { auto tensor = m_infer_request->get_tensor(port); + if (!tensor._so) + tensor._so = m_infer_request._so; if (std::dynamic_pointer_cast(tensor._ptr)) { auto remote_context = std::dynamic_pointer_cast(m_compiled_model->get_context()._ptr); OPENVINO_ASSERT(remote_context); @@ -64,6 +66,8 @@ void ov::proxy::InferRequest::set_tensor(const ov::Output& port, std::vector> ov::proxy::InferRequest::get_tensors(const ov::Output& port) const { auto tensors = m_infer_request->get_tensors(port); for (auto&& tensor : tensors) { + if (!tensor._so) + tensor._so = m_infer_request._so; if (std::dynamic_pointer_cast(tensor._ptr)) { auto remote_context = std::dynamic_pointer_cast(m_compiled_model->get_context()._ptr);