Skip to content

Commit

Permalink
Merge pull request #3 from yangwang201911/ywang2/fix_caching_test_fai…
Browse files Browse the repository at this point in the history
…lure

Fix caching test failure
  • Loading branch information
wgzintel authored Mar 28, 2023
2 parents a0e5e75 + f62f0cd commit 19fd4f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
4 changes: 0 additions & 4 deletions src/inference/tests/functional/caching_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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), _))
Expand Down
30 changes: 15 additions & 15 deletions src/plugins/auto/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,24 +431,24 @@ IExecutableNetworkInternal::Ptr MultiDeviceInferencePlugin::LoadNetworkImpl(cons
bool isCumulative =
(autoSContext->_performanceHint == IE::PluginConfigParams::CUMULATIVE_THROUGHPUT) ? true : false;
std::list<DeviceInformation> 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++) {
Expand Down

0 comments on commit 19fd4f0

Please sign in to comment.