[CPU] Fix user setting num_streams=0 (#20469)
This commit is contained in:
parent
29416d003e
commit
b3f6db7da4
@ -325,7 +325,9 @@ void Engine::GetPerformanceStreams(Config& config, const std::shared_ptr<ngraph:
|
||||
streams = config.streamExecutorConfig._streams == 1 ? 0 : config.streamExecutorConfig._streams;
|
||||
}
|
||||
|
||||
get_num_streams(streams, ngraphFunc, config);
|
||||
if (!((0 == config.streamExecutorConfig._streams) && config.streamExecutorConfig._streams_changed)) {
|
||||
get_num_streams(streams, ngraphFunc, config);
|
||||
}
|
||||
|
||||
config._config[CONFIG_KEY(CPU_THROUGHPUT_STREAMS)] = std::to_string(config.streamExecutorConfig._streams);
|
||||
}
|
||||
|
@ -137,6 +137,27 @@ TEST_F(OVClassConfigTestCPU, smoke_CpuExecNetworkCheckModelStreamsHasHigherPrior
|
||||
ASSERT_EQ(streams, value);
|
||||
}
|
||||
|
||||
TEST_F(OVClassConfigTestCPU, smoke_CpuExecNetworkCheckModelZeroStreams) {
|
||||
ov::Core ie;
|
||||
int32_t streams = 0;
|
||||
int32_t value = -1;
|
||||
|
||||
ASSERT_NO_THROW(ie.set_property(deviceName, ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)));
|
||||
|
||||
ov::AnyMap config;
|
||||
config[ov::num_streams.name()] = streams;
|
||||
ov::CompiledModel compiledModel = ie.compile_model(model, deviceName, config);
|
||||
|
||||
ASSERT_NO_THROW(value = compiledModel.get_property(ov::num_streams));
|
||||
|
||||
#if defined(OPENVINO_ARCH_ARM) || \
|
||||
defined(OPENVINO_ARCH_ARM64) // Will be removed after multiple streams is supported on ARM
|
||||
streams = 1;
|
||||
#endif
|
||||
|
||||
ASSERT_EQ(streams, value);
|
||||
}
|
||||
|
||||
TEST_F(OVClassConfigTestCPU, smoke_CpuExecNetworkCheckSparseWeigthsDecompressionRate) {
|
||||
ov::Core core;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user