diff --git a/samples/cpp/benchmark_app/main.cpp b/samples/cpp/benchmark_app/main.cpp index 1145a6558fa..48fc9522a72 100644 --- a/samples/cpp/benchmark_app/main.cpp +++ b/samples/cpp/benchmark_app/main.cpp @@ -565,7 +565,7 @@ int main(int argc, char* argv[]) { // If set batch size, disable the auto batching if (FLAGS_b > 0) { slog::warn << "Batch size is set. Auto batching will be disabled" << slog::endl; - core.set_property(ov::hint::allow_auto_batching(false)); + device_config.insert(ov::hint::allow_auto_batching(false)); } bool isDynamicNetwork = false; diff --git a/src/inference/src/dev/core_impl.cpp b/src/inference/src/dev/core_impl.cpp index 095b449090c..86f404f2ee3 100644 --- a/src/inference/src/dev/core_impl.cpp +++ b/src/inference/src/dev/core_impl.cpp @@ -848,11 +848,6 @@ void ov::CoreImpl::apply_auto_batching(const std::shared_ptr& m config.erase(batch_mode); if (disabled) return; - } else if (!coreConfig.get_allow_auto_batch()) { - if (is_virtual_device(deviceName)) { - config[ov::hint::allow_auto_batching.name()] = coreConfig.get_allow_auto_batch(); - } - return; } // check whether if the Auto-Batching is applicable to the device @@ -921,9 +916,6 @@ ov::Any ov::CoreImpl::get_property_for_core(const std::string& name) const { return decltype(ov::force_tbb_terminate)::value_type(flag); } else if (name == ov::cache_dir.name()) { return ov::Any(coreConfig.get_cache_dir()); - } else if (name == ov::hint::allow_auto_batching.name()) { - const auto flag = coreConfig.get_allow_auto_batch(); - return decltype(ov::hint::allow_auto_batching)::value_type(flag); } else if (name == ov::enable_mmap.name()) { const auto flag = coreConfig.get_enable_mmap(); return decltype(ov::enable_mmap)::value_type(flag); @@ -1295,13 +1287,6 @@ void ov::CoreImpl::CoreConfig::set_and_update(ov::AnyMap& config) { config.erase(it); } - it = config.find(ov::hint::allow_auto_batching.name()); - if (it != config.end()) { - auto flag = it->second.as(); - _flag_allow_auto_batching = flag; - config.erase(it); - } - it = config.find(ov::enable_mmap.name()); if (it != config.end()) { auto flag = it->second.as(); @@ -1320,10 +1305,6 @@ std::string ov::CoreImpl::CoreConfig::get_cache_dir() const { return _cacheConfig._cacheDir; } -bool ov::CoreImpl::CoreConfig::get_allow_auto_batch() const { - return _flag_allow_auto_batching; -} - bool ov::CoreImpl::CoreConfig::get_enable_mmap() const { return _flag_enable_mmap; } diff --git a/src/inference/src/dev/core_impl.hpp b/src/inference/src/dev/core_impl.hpp index 4f8ab8e38dd..a13f9fb6cd6 100644 --- a/src/inference/src/dev/core_impl.hpp +++ b/src/inference/src/dev/core_impl.hpp @@ -83,8 +83,6 @@ private: std::string get_cache_dir() const; - bool get_allow_auto_batch() const; - bool get_enable_mmap() const; // Creating thread-safe copy of config including shared_ptr to ICacheManager @@ -95,7 +93,6 @@ private: mutable std::mutex _cacheConfigMutex; CacheConfig _cacheConfig; std::map _cacheConfigPerDevice; - bool _flag_allow_auto_batching = true; bool _flag_enable_mmap = true; }; diff --git a/src/plugins/auto/src/plugin.cpp b/src/plugins/auto/src/plugin.cpp index c8c7face1fa..d21bf290fb5 100644 --- a/src/plugins/auto/src/plugin.cpp +++ b/src/plugins/auto/src/plugin.cpp @@ -358,7 +358,7 @@ IExecutableNetworkInternal::Ptr MultiDeviceInferencePlugin::LoadNetworkImpl(cons loadConfig.set_property(ov::hint::performance_mode(ov::hint::PerformanceMode::LATENCY)); } // updateFromMap will check config valid - loadConfig.set_user_property(PreProcessConfig(config), workModeAuto); + loadConfig.set_user_property(PreProcessConfig(config)); loadConfig.apply_user_properties(); if (!workModeAuto) { if (itorConfig != config.end() && itorConfig->second != InferenceEngine::PluginConfigParams::THROUGHPUT) { @@ -383,22 +383,6 @@ IExecutableNetworkInternal::Ptr MultiDeviceInferencePlugin::LoadNetworkImpl(cons if (priorities.find("AUTO") != std::string::npos || priorities.find("MULTI") != std::string::npos) { IE_THROW() << "The device candidate list should not include the meta plugin for " << GetName() << " device"; } - // If the user sets the property, insert the property into the deviceConfig - auto insertPropToConfig = [&](std::string property, - std::string& deviceName, - std::map& deviceConfig) { - if (deviceConfig.find(property) == deviceConfig.end()) { - auto tmpiter = fullConfig.find(property); - if (tmpiter != fullConfig.end()) { - deviceConfig.insert({tmpiter->first, tmpiter->second}); - LOG_INFO_TAG("device:%s, config:%s=%s", - deviceName.c_str(), - tmpiter->first.c_str(), - tmpiter->second.c_str()); - } - } - }; - // check the configure and check if need to set PerfCounters configure to device // and set filter configure OV_ITT_SCOPED_TASK(itt::domains::MULTIPlugin, "MultiDeviceInferencePlugin::LoadNetworkImpl::AutoMode"); @@ -411,7 +395,7 @@ IExecutableNetworkInternal::Ptr MultiDeviceInferencePlugin::LoadNetworkImpl(cons autoSContext->_needPerfCounters = true; } autoSContext->_modelPriority = MapPriorityValues(loadConfig.get_property(ov::hint::model_priority)); - autoSContext->_batchingDisabled = !(loadConfig.get_property(ov::hint::allow_auto_batching)); + autoSContext->_batchingDisabled = loadConfig.is_batching_disabled(); // set performanceHint for AutoExecutableNetwork autoSContext->_performanceHint = loadConfig.get_property(ov::hint::performance_mode.name()).as(); // filter the device that supports filter configure @@ -462,11 +446,6 @@ IExecutableNetworkInternal::Ptr MultiDeviceInferencePlugin::LoadNetworkImpl(cons config.first.c_str(), config.second.c_str()); } - // carry on batch configs only if user explicitly sets - if (loadConfig.is_set_by_user(ov::hint::allow_auto_batching)) - insertPropToConfig(ov::hint::allow_auto_batching.name(), iter->deviceName, configs); - if (loadConfig.is_set_by_user(ov::auto_batch_timeout)) - insertPropToConfig(ov::auto_batch_timeout.name(), iter->deviceName, configs); LOG_INFO_TAG("device:%s, priority:%ld", iter->deviceName.c_str(), iter->devicePriority); } autoSContext->_modelPath = clonedModelPath; @@ -517,7 +496,7 @@ QueryNetworkResult MultiDeviceInferencePlugin::QueryNetwork(const CNNNetwork& auto queryconfig = _pluginConfig; // updateFromMap will check config valid - queryconfig.set_user_property(PreProcessConfig(config), (GetName() == "AUTO")? true : false); + queryconfig.set_user_property(PreProcessConfig(config)); queryconfig.apply_user_properties(); auto fullproperty = queryconfig.get_full_properties(); // this can be updated when plugin switch to 2.0 API diff --git a/src/plugins/auto/src/plugin_config.cpp b/src/plugins/auto/src/plugin_config.cpp index a8bdede70a3..3c1c08545d5 100644 --- a/src/plugins/auto/src/plugin_config.cpp +++ b/src/plugins/auto/src/plugin_config.cpp @@ -28,9 +28,6 @@ void PluginConfig::set_default() { std::make_tuple(ov::hint::num_requests, 0, UnsignedTypeValidator()), std::make_tuple(ov::intel_auto::enable_startup_fallback, true), std::make_tuple(ov::intel_auto::enable_runtime_fallback, true), - // TODO 1) allow_auto_batch 2) auto_batch_timeout - std::make_tuple(ov::hint::allow_auto_batching, true), - std::make_tuple(ov::auto_batch_timeout, 1000), // Legacy API properties std::make_tuple(exclusive_asyc_requests, false), // RO for register only @@ -70,6 +67,13 @@ ov::Any PluginConfig::get_property(const std::string& name) const { return internal_properties.at(name); } +bool PluginConfig::is_batching_disabled() const { + if (user_properties.find(ov::hint::allow_auto_batching.name()) != user_properties.end()) { + return !user_properties.at(ov::hint::allow_auto_batching.name()).as(); + } + return false; +} + bool PluginConfig::is_supported(const std::string& name) const { bool supported = internal_properties.find(name) != internal_properties.end(); bool has_validator = property_validators.find(name) != property_validators.end(); @@ -81,7 +85,7 @@ bool PluginConfig::is_set_by_user(const std::string& name) const { return user_properties.find(name) != user_properties.end(); } -void PluginConfig::set_user_property(const ov::AnyMap& config, bool checkfirstlevel) { +void PluginConfig::set_user_property(const ov::AnyMap& config) { // user property, accept either internal property, or secondary property for hardware plugin // TODO: for multi, other first level property are also accepted for (auto& kv : config) { diff --git a/src/plugins/auto/src/plugin_config.hpp b/src/plugins/auto/src/plugin_config.hpp index 762c0b77e90..e42edb96ba0 100644 --- a/src/plugins/auto/src/plugin_config.hpp +++ b/src/plugins/auto/src/plugin_config.hpp @@ -74,8 +74,9 @@ public: void set_default(); void set_property(const ov::AnyMap& properties); - void set_user_property(const ov::AnyMap& properties, bool checkfirstlevel = true); + void set_user_property(const ov::AnyMap& properties); ov::Any get_property(const std::string& name) const; + bool is_batching_disabled() const; bool is_set_by_user(const std::string& name) const; bool is_supported(const std::string& name) const; diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp index 5362f5af947..ba2e8caa6be 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp @@ -103,8 +103,6 @@ const std::vector default_properties = { {ov::enable_profiling(false)}, {ov::log::level("LOG_NONE")}, {ov::hint::model_priority(ov::hint::Priority::MEDIUM)}, - {ov::hint::allow_auto_batching(true)}, - {ov::auto_batch_timeout("1000")}, {ov::hint::execution_mode(ov::hint::ExecutionMode::PERFORMANCE)}, {ov::intel_auto::device_bind_buffer(false)}, {ov::intel_auto::enable_startup_fallback(true)}, diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp index ac89c46dd38..b416191e4c8 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration.hpp @@ -714,20 +714,6 @@ TEST(OVClassBasicTest, GetUnsupportedPropertyCoreThrow) { ASSERT_THROW(ie.get_property("unsupported_property"), ov::Exception); } -TEST(OVClassBasicTest, SetAllowAutoBatchingPropertyCoreNoThrows) { - ov::Core ie = createCoreWithTemplate(); - - bool value1 = true; - OV_ASSERT_NO_THROW(ie.set_property(ov::hint::allow_auto_batching(false))); - OV_ASSERT_NO_THROW(value1 = ie.get_property(ov::hint::allow_auto_batching.name()).as()); - ASSERT_FALSE(value1); - - bool value2 = false; - OV_ASSERT_NO_THROW(ie.set_property(ov::hint::allow_auto_batching(true))); - OV_ASSERT_NO_THROW(value2 = ie.get_property(ov::hint::allow_auto_batching.name()).as()); - ASSERT_TRUE(value2); -} - TEST_P(OVClassSetLogLevelConfigTest, SetConfigNoThrow) { ov::Core ie = createCoreWithTemplate(); // log level