diff --git a/src/plugins/intel_cpu/src/compiled_model.cpp b/src/plugins/intel_cpu/src/compiled_model.cpp index a695bae170b..73cdc6b51c5 100644 --- a/src/plugins/intel_cpu/src/compiled_model.cpp +++ b/src/plugins/intel_cpu/src/compiled_model.cpp @@ -222,6 +222,7 @@ ov::Any CompiledModel::get_property(const std::string& name) const { RO_property(ov::intel_cpu::sparse_weights_decompression_rate.name()), RO_property(ov::hint::dynamic_quantization_group_size.name()), RO_property(ov::hint::kv_cache_precision.name()), + RO_property(ov::optimal_batch_size.name()), }; OPENVINO_SUPPRESS_DEPRECATED_START @@ -299,6 +300,8 @@ ov::Any CompiledModel::get_property(const std::string& name) const { config.fcDynamicQuantizationGroupSize); } else if (name == ov::hint::kv_cache_precision) { return decltype(ov::hint::kv_cache_precision)::value_type(config.kvCachePrecision); + } else if (name == ov::optimal_batch_size.name()) { + return decltype(ov::optimal_batch_size)::value_type(1); } OPENVINO_THROW("Unsupported property: ", name); } diff --git a/src/plugins/intel_cpu/src/plugin.cpp b/src/plugins/intel_cpu/src/plugin.cpp index 06e09029ead..698fe48ab88 100644 --- a/src/plugins/intel_cpu/src/plugin.cpp +++ b/src/plugins/intel_cpu/src/plugin.cpp @@ -445,6 +445,7 @@ ov::Any Plugin::get_ro_property(const std::string& name, const ov::AnyMap& optio RO_property(ov::device::capabilities.name()), RO_property(ov::device::type.name()), RO_property(ov::device::architecture.name()), + RO_property(ov::optimal_batch_size.name()), }; // the whole config is RW before model is loaded. std::vector rwProperties{ @@ -536,6 +537,8 @@ ov::Any Plugin::get_ro_property(const std::string& name, const ov::AnyMap& optio #else # error "Undefined system processor" #endif + } else if (name == ov::optimal_batch_size){ + return decltype(ov::optimal_batch_size)::value_type(1); } OPENVINO_THROW("Cannot get unsupported property: ", name); diff --git a/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_plugin/properties.cpp b/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_plugin/properties.cpp index 92d800839b1..c711ddcb86e 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_plugin/properties.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_plugin/properties.cpp @@ -37,6 +37,7 @@ TEST_F(OVClassConfigTestCPU, smoke_PluginAllSupportedPropertiesAreAvailable) { RO_property(ov::device::capabilities.name()), RO_property(ov::device::type.name()), RO_property(ov::device::architecture.name()), + RO_property(ov::optimal_batch_size.name()), // read write RW_property(ov::num_streams.name()), RW_property(ov::affinity.name()), @@ -384,4 +385,14 @@ TEST_F(OVClassConfigTestCPU, smoke_PluginCheckCPUDeviceArchitecture) { #endif } +TEST_F(OVClassConfigTestCPU, smoke_CpuExceNetworkCheckCPUOptimalBatchSize) { + ov::Core ie; + ov::Any value; + ov::CompiledModel compiledModel; + + ASSERT_NO_THROW(compiledModel = ie.compile_model(model, deviceName)); + ASSERT_NO_THROW(value = compiledModel.get_property(ov::optimal_batch_size)); + ASSERT_EQ(value.as(), 1); +} + } // namespace