From cb9b50a49dffcf4ea96751e6f72a9ad9383b7ab7 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 19 May 2023 13:39:54 +0400 Subject: [PATCH] Port fixes from master to LTS (#17324) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update ie_common.h (#16860) * [GPU] Added try/catch for device detection loop to skip platforms which throw an exception (#17011) * ONNX FE - model loading fix (#17091) * Path retrieval fix * More detailed messages in the failing test * Exe path with model name --------- Co-authored-by: Michal Lukaszewski * Upper-bound for patchelf (#17177) * Apply suggestions from code review --------- Co-authored-by: Ian Hunter Co-authored-by: Vladimir Paramuzov Co-authored-by: Tomasz DoĊ‚bniak Co-authored-by: Michal Lukaszewski Co-authored-by: Alina Kladieva --- src/bindings/python/wheel/requirements-dev.txt | 2 +- src/frontends/onnx/frontend/src/frontend.cpp | 2 +- src/frontends/onnx/tests/load_from.cpp | 13 +++++++------ src/frontends/onnx/tests/unit_test.manifest | 2 -- src/inference/include/ie/ie_common.h | 8 ++++---- .../src/runtime/ocl/ocl_device_detector.cpp | 16 ++++++++++------ 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/bindings/python/wheel/requirements-dev.txt b/src/bindings/python/wheel/requirements-dev.txt index 13aecd85a63..695e850d649 100644 --- a/src/bindings/python/wheel/requirements-dev.txt +++ b/src/bindings/python/wheel/requirements-dev.txt @@ -1,3 +1,3 @@ setuptools>=65.6.1 wheel>=0.38.1 -patchelf; sys_platform == 'linux' and platform_machine == 'x86_64' +patchelf<=0.17.2.1; sys_platform == 'linux' and platform_machine == 'x86_64' diff --git a/src/frontends/onnx/frontend/src/frontend.cpp b/src/frontends/onnx/frontend/src/frontend.cpp index d1a4d14ddb7..9b9d2a3ac66 100644 --- a/src/frontends/onnx/frontend/src/frontend.cpp +++ b/src/frontends/onnx/frontend/src/frontend.cpp @@ -59,7 +59,7 @@ InputModel::Ptr FrontEnd::load_impl(const std::vector& variants) const if (variants[0].is()) { const auto stream = variants[0].as(); if (variants.size() > 1 && variants[1].is()) { - const auto path = variants[0].as(); + const auto path = variants[1].as(); return std::make_shared(*stream, path, m_extensions); } #if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) diff --git a/src/frontends/onnx/tests/load_from.cpp b/src/frontends/onnx/tests/load_from.cpp index 8693565000e..ae6fce08487 100644 --- a/src/frontends/onnx/tests/load_from.cpp +++ b/src/frontends/onnx/tests/load_from.cpp @@ -25,25 +25,26 @@ static LoadFromFEParam getTestData() { return res; } -// TODO: 83471 TEST_P(FrontEndLoadFromTest, testLoadFromStreamAndPassPath) { NGRAPH_SUPPRESS_DEPRECATED_START - const auto path = file_util::path_join(TEST_ONNX_MODELS_DIRNAME, "external_data/external_data.onnx"); + const auto path = file_util::path_join(CommonTestUtils::getExecutableDirectory(), + TEST_ONNX_MODELS_DIRNAME, + "external_data/external_data.onnx"); NGRAPH_SUPPRESS_DEPRECATED_END std::ifstream ifs(path, std::ios::in | std::ios::binary); - ASSERT_TRUE(ifs.is_open()); + ASSERT_TRUE(ifs.is_open()) << "Could not open an ifstream for the model path: " << path; std::istream* is = &ifs; std::vector frontends; FrontEnd::Ptr fe; ASSERT_NO_THROW(frontends = m_fem.get_available_front_ends()); - ASSERT_NO_THROW(m_frontEnd = m_fem.load_by_model(is)); + ASSERT_NO_THROW(m_frontEnd = m_fem.load_by_model(is)) << "Could not create the ONNX FE using the istream object"; ASSERT_NE(m_frontEnd, nullptr); - ASSERT_NO_THROW(m_inputModel = m_frontEnd->load(is, path)); + ASSERT_NO_THROW(m_inputModel = m_frontEnd->load(is, path)) << "Could not load the model"; ASSERT_NE(m_inputModel, nullptr); std::shared_ptr function; - ASSERT_NO_THROW(function = m_frontEnd->convert(m_inputModel)); + ASSERT_NO_THROW(function = m_frontEnd->convert(m_inputModel)) << "Could not convert the model to OV representation"; ASSERT_NE(function, nullptr); } diff --git a/src/frontends/onnx/tests/unit_test.manifest b/src/frontends/onnx/tests/unit_test.manifest index bef28da5e5c..445667a50f0 100644 --- a/src/frontends/onnx/tests/unit_test.manifest +++ b/src/frontends/onnx/tests/unit_test.manifest @@ -2,5 +2,3 @@ ONNXLoadTest/FrontEndLoadFromTest.testLoadFromTwoFiles/onnx ONNXLoadTest/FrontEndLoadFromTest.testLoadFromTwoStreams/onnx -# exception: invalid external data: ExternalDataInfo -ONNXLoadTest/FrontEndLoadFromTest.testLoadFromStreamAndPassPath/onnx diff --git a/src/inference/include/ie/ie_common.h b/src/inference/include/ie/ie_common.h index efe5f3650ce..187ec6c5a3f 100644 --- a/src/inference/include/ie/ie_common.h +++ b/src/inference/include/ie/ie_common.h @@ -78,10 +78,10 @@ enum Layout : uint8_t { NDHWC = 4, //!< NDHWC layout for input / output blobs // weight layouts - OIHW = 64, //!< NDHWC layout for operation weights - GOIHW = 65, //!< NDHWC layout for operation weights - OIDHW = 66, //!< NDHWC layout for operation weights - GOIDHW = 67, //!< NDHWC layout for operation weights + OIHW = 64, //!< OIHW layout for operation weights + GOIHW = 65, //!< GOIHW layout for operation weights + OIDHW = 66, //!< OIDHW layout for operation weights + GOIDHW = 67, //!< GOIDHW layout for operation weights // Scalar SCALAR = 95, //!< A scalar layout diff --git a/src/plugins/intel_gpu/src/runtime/ocl/ocl_device_detector.cpp b/src/plugins/intel_gpu/src/runtime/ocl/ocl_device_detector.cpp index 874187f003c..f78d38a98f2 100644 --- a/src/plugins/intel_gpu/src/runtime/ocl/ocl_device_detector.cpp +++ b/src/plugins/intel_gpu/src/runtime/ocl/ocl_device_detector.cpp @@ -201,12 +201,16 @@ std::vector ocl_device_detector::create_device_list() const { for (auto& id : platform_ids) { cl::Platform platform = cl::Platform(id); - std::vector devices; - platform.getDevices(CL_DEVICE_TYPE_ALL, &devices); - for (auto& device : devices) { - if (!does_device_match_config(device)) - continue; - supported_devices.emplace_back(std::make_shared(device, cl::Context(device), id)); + try { + std::vector devices; + platform.getDevices(CL_DEVICE_TYPE_ALL, &devices); + for (auto& device : devices) { + if (!does_device_match_config(device)) + continue; + supported_devices.emplace_back(std::make_shared(device, cl::Context(device), id)); + } + } catch (std::exception& ex) { + continue; } } OPENVINO_ASSERT(!supported_devices.empty(), create_device_error_msg);