From 5871b355ecb41570d12ca6bd23abfddeeecd5588 Mon Sep 17 00:00:00 2001 From: Xuejun Zhai Date: Tue, 1 Aug 2023 05:22:21 +0800 Subject: [PATCH] [AUTO BATCH PLUGIN] update time out from set property (#18795) * [AUTO BATCH PLUGIN] update time out from set property Signed-off-by: Zhai, Xuejun * [AUTO BATCH PLUGIN] update test case from time out property Signed-off-by: Zhai, Xuejun * [AUTO BATCH PLUGIN] fix review comment Signed-off-by: Zhai, Xuejun --------- Signed-off-by: Zhai, Xuejun Co-authored-by: Haiqi Pan --- src/plugins/auto_batch/src/compiled_model.cpp | 16 ++++++++++------ .../unit/compile_model_get_property_test.cpp | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/auto_batch/src/compiled_model.cpp b/src/plugins/auto_batch/src/compiled_model.cpp index a6dfbccaf50..0bcb0b17d30 100644 --- a/src/plugins/auto_batch/src/compiled_model.cpp +++ b/src/plugins/auto_batch/src/compiled_model.cpp @@ -166,12 +166,16 @@ std::shared_ptr CompiledModel::get_runtime_model() const { } void CompiledModel::set_property(const ov::AnyMap& properties) { - auto time_out = properties.find(ov::auto_batch_timeout.name()); - if (time_out == properties.end() || properties.size() > 1) { - OPENVINO_THROW("The only config that can be changed on the fly for the AutoBatching is the ", - ov::auto_batch_timeout.name()); - } else { - m_time_out = time_out->second.as(); + for (const auto& property : properties) { + if (property.first == ov::auto_batch_timeout.name()) { + m_time_out = property.second.as(); + m_config[ov::auto_batch_timeout.name()] = property.second.as(); + } else { + OPENVINO_THROW("AutoBatching Compiled Model dosen't support property", + property.first, + ". The only property that can be changed on the fly is the ", + ov::auto_batch_timeout.name()); + } } } diff --git a/src/plugins/auto_batch/tests/unit/compile_model_get_property_test.cpp b/src/plugins/auto_batch/tests/unit/compile_model_get_property_test.cpp index 5159151f892..c9c56ebfb72 100644 --- a/src/plugins/auto_batch/tests/unit/compile_model_get_property_test.cpp +++ b/src/plugins/auto_batch/tests/unit/compile_model_get_property_test.cpp @@ -156,8 +156,8 @@ const std::vector compile_model_get_property_param_test = { get_property_param{METRIC_KEY(SUPPORTED_CONFIG_KEYS), false}, get_property_param{ov::execution_devices.name(), false}, get_property_param{CONFIG_KEY(AUTO_BATCH_DEVICE_CONFIG), false}, - get_property_param{CONFIG_KEY(AUTO_BATCH_TIMEOUT), false}, - get_property_param{CONFIG_KEY(CACHE_DIR), false}, + get_property_param{ov::auto_batch_timeout.name(), false}, + get_property_param{ov::cache_dir.name(), false}, // Config in dependent m_plugin get_property_param{"OPTIMAL_BATCH_SIZE", false}, // Incorrect Property