Skip to content

Commit f4da9f1

Browse files
[OVEP] Remove checks from load_config (#765)
1 parent ba8e3e7 commit f4da9f1

File tree

1 file changed

+5
-26
lines changed

1 file changed

+5
-26
lines changed

onnxruntime/core/providers/openvino/backends/basic_backend.cc

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -274,31 +274,14 @@ void BasicBackend::PopulateConfigValue(ov::AnyMap& device_config) {
274274
return devices;
275275
};
276276

277-
// Check if a property is supported and mutable
278-
auto is_supported_and_mutable = [&](const std::string& key,
279-
const std::vector<ov::PropertyName>& supported_config) -> bool {
280-
auto it = std::find_if(supported_config.begin(), supported_config.end(), [&](const ov::PropertyName& property) {
281-
return property == key && property.is_mutable();
282-
});
283-
return it != supported_config.end();
284-
};
285-
286-
// Set properties if they are valid, else log a warning if the property is missing or immutable by skipping the same
287-
auto set_target_properties = [&](const std::string& device, const ov::AnyMap& config_options,
288-
const std::vector<ov::PropertyName>& supported_properties) {
277+
// Set properties, Validation will be handled by OpenVINO Core
278+
auto set_target_properties = [&](const std::string& device, const ov::AnyMap& config_options) {
289279
for (const auto& [key, value] : config_options) {
290280
if ((key.find("NPUW") != std::string::npos) ||
291281
((device_config.find(key) != device_config.end()) && session_context_.enable_causallm)) {
292282
continue;
293283
}
294-
if (is_supported_and_mutable(key, supported_properties)) {
295-
OVCore::Get()->core.set_property(device, ov::AnyMap{{key, value}});
296-
} else {
297-
LOGS_DEFAULT(WARNING) << "WARNING: Property \"" << key
298-
<< "\" is either unsupported in current OpenVINO version"
299-
<< " or property is immutable for target device \""
300-
<< device << "\". Skipping setting this property.";
301-
}
284+
OVCore::Get()->core.set_property(device, ov::AnyMap{{key, value}});
302285
}
303286
};
304287

@@ -317,18 +300,14 @@ void BasicBackend::PopulateConfigValue(ov::AnyMap& device_config) {
317300
// Set properties only for individual devices (e.g., "CPU", "GPU")
318301
for (const std::string& device : individual_devices) {
319302
if (target_config.count(device)) {
320-
// Get supported properties for each individual device
321-
auto device_properties = OVCore::Get()->core.get_property(device, ov::supported_properties);
322303
// Set properties for the device
323-
set_target_properties(device, target_config.at(device), device_properties);
304+
set_target_properties(device, target_config.at(device));
324305
}
325306
}
326307
} else {
327308
if (target_config.count(session_context_.device_type)) {
328-
auto supported_properties = OVCore::Get()->core.get_property(session_context_.device_type,
329-
ov::supported_properties);
330309
set_target_properties(session_context_.device_type,
331-
target_config.at(session_context_.device_type), supported_properties);
310+
target_config.at(session_context_.device_type));
332311
}
333312
}
334313
}

0 commit comments

Comments
 (0)