Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e001f46

Browse files
committedMar 17, 2025·
test fixes
1 parent 9f6d677 commit e001f46

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed
 

‎src/inference/dev_api/openvino/runtime/plugin_config.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class OPENVINO_RUNTIME_API PluginConfig {
159159
PluginConfig& operator=(PluginConfig&& other) = delete;
160160

161161
void set_property(const ov::AnyMap& properties);
162-
void set_user_property(const ov::AnyMap& properties, OptionVisibility allowed_visibility = OptionVisibility::ANY);
162+
virtual void set_user_property(const ov::AnyMap& properties, OptionVisibility allowed_visibility = OptionVisibility::ANY);
163163
Any get_property(const std::string& name, OptionVisibility allowed_visibility = OptionVisibility::ANY) const;
164164

165165
template <typename... Properties>

‎src/plugins/intel_cpu/src/config.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,20 @@ Config Config::clone(int sub_stream_idx, bool enable_node_split) const {
117117
return new_config;
118118
}
119119

120+
void Config::set_user_property(const ov::AnyMap& config, OptionVisibility allowed_visibility) {
121+
const auto& it = config.find(ov::num_streams.name());
122+
if (it != config.end()) {
123+
auto num_streams = it->second.as<std::string>();
124+
auto new_config = config;
125+
new_config.at(ov::num_streams.name()) = num_streams;
126+
PluginConfig::set_user_property(new_config, allowed_visibility);
127+
128+
return;
129+
}
130+
131+
PluginConfig::set_user_property(config, allowed_visibility);
132+
}
133+
120134
void Config::apply_rt_info(const IRemoteContext* context, const ov::RTMap& rt_info) {
121135
apply_rt_info_property(ov::hint::kv_cache_precision, rt_info);
122136
apply_rt_info_property(ov::hint::dynamic_quantization_group_size, rt_info);

‎src/plugins/intel_cpu/src/config.h

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ struct Config : public ov::PluginConfig {
2525
Config(const Config& other);
2626
Config& operator=(const Config& other);
2727

28+
void set_user_property(const ov::AnyMap& config, OptionVisibility allowed_visibility) override;
29+
2830
private:
2931
void finalize_impl(const IRemoteContext* context, const ov::Model* model) override;
3032
void apply_model_specific_options(const IRemoteContext* context, const ov::Model& model) override;

‎src/plugins/intel_cpu/src/plugin.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ ov::Any Plugin::get_property(const std::string& name, const ov::AnyMap& options)
364364
return res;
365365
}
366366

367-
return m_plugin_config.get_property(name, OptionVisibility::RELEASE);
367+
auto config = m_plugin_config;
368+
config.finalize(get_default_context().get(), nullptr);
369+
return config.get_property(name, OptionVisibility::RELEASE);
368370
}
369371

370372
ov::SupportedOpsMap Plugin::query_model(const std::shared_ptr<const ov::Model>& model, const ov::AnyMap& properties) const {
@@ -445,10 +447,8 @@ std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& model_str
445447
deserializer >> model;
446448

447449
Config config = m_plugin_config;
448-
config.set_user_property(properties, OptionVisibility::RELEASE);
450+
config.set_user_property(_properties, OptionVisibility::RELEASE);
449451

450-
// import config props from caching model
451-
// calculate_streams(config, model, true);
452452
config.finalize(get_default_context().get(), model.get());
453453

454454
auto compiled_model = std::make_shared<CompiledModel>(model, shared_from_this(), config, loaded_from_cache);

‎src/plugins/intel_cpu/tests/functional/custom/behavior/ov_plugin/properties.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,7 @@ TEST_F(OVClassConfigTestCPU, smoke_PluginSetConfigLogLevel) {
285285

286286
// check throwing message
287287
auto property = ov::PropertyName(ov::log::level.name(), ov::PropertyMutability::RW);
288-
const std::string expect_message = std::string("Wrong value DUMMY VALUE for property key ") +
289-
ov::log::level.name() + ". Expected only ov::log::Level::NO/ERR/WARNING/INFO/DEBUG/TRACE.";
290-
OV_EXPECT_THROW(ie.set_property("CPU", {{property, "DUMMY VALUE"}}),
291-
ov::Exception,
292-
testing::HasSubstr(expect_message));
288+
EXPECT_THROW(ie.set_property("CPU", {{property, "DUMMY VALUE"}}), ov::Exception);
293289
}
294290

295291
TEST_F(OVClassConfigTestCPU, smoke_PluginCheckCPUExecutionDevice) {

0 commit comments

Comments
 (0)
Please sign in to comment.