From f62f0cddfa1bd13e74bd5d4913bb0f2cb16716db Mon Sep 17 00:00:00 2001 From: "Wang, Yang" Date: Tue, 28 Mar 2023 15:17:27 +0800 Subject: [PATCH] enable skipped caching test case. --- .../tests/functional/caching_test.cpp | 4 --- src/plugins/auto/plugin.cpp | 30 +++++++++---------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/inference/tests/functional/caching_test.cpp b/src/inference/tests/functional/caching_test.cpp index 03b3aaf5f38afb..531c115a32fb91 100644 --- a/src/inference/tests/functional/caching_test.cpp +++ b/src/inference/tests/functional/caching_test.cpp @@ -2169,7 +2169,6 @@ TEST_P(CachingTest, LoadAUTO_OneDeviceNoImportExport) { // Test that it is safe to load multiple devices sharing same cache // In case of sporadic failures - increase 'TEST_DURATION_MS' 100x times for better reproducibility TEST_P(CachingTest, LoadMulti_race) { - GTEST_SKIP(); const auto TEST_DURATION_MS = 2000; const auto TEST_DEVICE_MAX_COUNT = 10; EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber()); @@ -2211,7 +2210,6 @@ TEST_P(CachingTest, LoadMulti_race) { // Test that it is safe to load multiple devices through loadNetwork // In case of sporadic failures - increase 'TEST_DURATION_MS' 100x times for better reproducibility TEST_P(CachingTest, LoadMultiWithConfig_race) { - GTEST_SKIP(); const auto TEST_DURATION_MS = 2000; const auto TEST_DEVICE_MAX_COUNT = 10; EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber()); @@ -2252,7 +2250,6 @@ TEST_P(CachingTest, LoadMultiWithConfig_race) { // Test loading of devices with different architectures // In case of sporadic failures - increase 'TEST_DEVICE_MAX_COUNT' 100x times for better reproducibility TEST_P(CachingTest, LoadMulti_Archs) { - GTEST_SKIP(); const auto TEST_DEVICE_MAX_COUNT = 30; // Shall be >= 2 EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber()); EXPECT_CALL(*mockPlugin, QueryNetwork(_, _)).Times(AnyNumber()); @@ -2303,7 +2300,6 @@ TEST_P(CachingTest, LoadMulti_Archs) { // Test loading of devices which don't support caching // In case of sporadic failures - increase 'TEST_DEVICE_MAX_COUNT' 100x times for better reproducibility TEST_P(CachingTest, LoadMulti_NoCachingOnDevice) { - GTEST_SKIP(); const auto TEST_DEVICE_MAX_COUNT = 100; // Looks enough to catch potential race conditions EXPECT_CALL(*mockPlugin, GetMetric(_, _)).Times(AnyNumber()); EXPECT_CALL(*mockPlugin, GetMetric(METRIC_KEY(IMPORT_EXPORT_SUPPORT), _)) diff --git a/src/plugins/auto/plugin.cpp b/src/plugins/auto/plugin.cpp index c688f1ef27c586..531af4ef31f346 100644 --- a/src/plugins/auto/plugin.cpp +++ b/src/plugins/auto/plugin.cpp @@ -431,24 +431,24 @@ IExecutableNetworkInternal::Ptr MultiDeviceInferencePlugin::LoadNetworkImpl(cons bool isCumulative = (autoSContext->_performanceHint == IE::PluginConfigParams::CUMULATIVE_THROUGHPUT) ? true : false; std::list devicesWithPriority(supportDevices.begin(), supportDevices.end()); - if (!isCumulative) { - if (modelPath.empty()) { - // if network is valid + if (modelPath.empty()) { + // if network is valid + LOG_INFO_TAG("load with CNN network"); + supportDevices = FilterDeviceByNetwork(supportDevicesByConfig, network); + clonedNetwork = InferenceEngine::details::cloneNetwork(network); + // clone the network, in case of reshape conflict + } else { + // model path, enable model load with single device situation + if (supportDevices.size() > 1 && !isCumulative) { + clonedNetwork = GetCore()->ReadNetwork(modelPath, std::string()); + // do we really need to disable model path? + clonedModelPath = ""; LOG_INFO_TAG("load with CNN network"); - supportDevices = FilterDeviceByNetwork(supportDevicesByConfig, network); - // clone the network, in case of reshape conflict - clonedNetwork = InferenceEngine::details::cloneNetwork(network); } else { - // model path, enable model load with single device situation - if (supportDevices.size() > 1) { - clonedNetwork = GetCore()->ReadNetwork(modelPath, std::string()); - // do we really need to disable model path? - clonedModelPath = ""; - LOG_INFO_TAG("load with CNN network"); - } else { - LOG_INFO_TAG("load with model path"); - } + LOG_INFO_TAG("load with model path"); } + } + if (!isCumulative) { devicesWithPriority = GetValidDevice(supportDevices, networkPrecision); } for (auto iter = devicesWithPriority.begin(); iter != devicesWithPriority.end(); iter++) {