[CPU] Set lower bound for nstreams to 1 (#8747)

This commit is contained in:
Zlobin Vladimir 2021-11-23 06:42:12 +03:00 committed by GitHub
parent c2ddfdc940
commit 251883001c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -533,13 +533,15 @@ Engine::LoadExeNetworkImpl(const InferenceEngine::CNNNetwork &network, const std
// network is below general threshold
num_streams = std::max(default_num_streams, num_streams_less_aggressive);
}
int ovPerfHintNumRequests = engConfig.perfHintsConfig.ovPerfHintNumRequests; // set thru SetConfig to the plugin
auto num_requests = config.find(PluginConfigParams::KEY_PERFORMANCE_HINT_NUM_REQUESTS);
if (engConfig.perfHintsConfig.ovPerfHintNumRequests) // set thru SetConfig to the plugin
num_streams = std::min(engConfig.perfHintsConfig.ovPerfHintNumRequests,
engConfig.perfHintsConfig.ovPerfHintNumRequests);
if (num_requests != config.end()) // arrived with config to the LoadNetwork (and thus higher pri)
num_streams = std::min(num_streams,
PerfHintsConfig::CheckPerformanceHintRequestValue(num_requests->second));
if (num_requests != config.end()) {
// arrived with config to the LoadNetwork (and thus higher pri)
ovPerfHintNumRequests = PerfHintsConfig::CheckPerformanceHintRequestValue(num_requests->second);
}
num_streams = std::min(num_streams, std::max(ovPerfHintNumRequests, 1));
config[PluginConfigParams::KEY_CPU_THROUGHPUT_STREAMS] = std::to_string(num_streams);
}
}