Skip to content

Commit dfab5bf

Browse files
[OVEP] OpenVINO features v1.23.0 patch (microsoft#25725)
### Description This PR fixes the load_config handling logic delegating the filtering to be maintained by OV toolkit going ahead (this enables cache_dir for CPU device via load_config) & redundant upsample Op fixes. --------- Co-authored-by: jatinwadhwa921 <[email protected]>
1 parent 03301cc commit dfab5bf

File tree

2 files changed

+5
-34
lines changed

2 files changed

+5
-34
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
}

onnxruntime/core/providers/openvino/ov_versions/data_ops.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,7 @@ void DataOps::populate_op_mode_supported() {
469469
}
470470
}
471471

472-
// check for input dimensions
473472
const auto& x_arg = node->InputDefs()[0];
474-
auto shape = x_arg->Shape();
475-
if (shape != nullptr) {
476-
// input tensor rank cannot be of one dimension
477-
if (shape->dim_size() == 1 || shape->dim_size() == 4) {
478-
return true;
479-
}
480-
}
481473
// x_arg supports only float, int8 and float16 type
482474
if ((x_arg->TypeAsProto()->tensor_type().elem_type() ==
483475
ONNX_NAMESPACE::TensorProto_DataType::TensorProto_DataType_FLOAT) ||

0 commit comments

Comments
 (0)