Skip to content

Commit 609dfbf

Browse files
authored
Fix the load_config not work when set INFERENCE_PRECISION_HINT (#777)
1 parent 725744a commit 609dfbf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,14 @@ void BasicBackend::PopulateConfigValue(ov::AnyMap& device_config) {
277277
// Set properties, Validation will be handled by OpenVINO Core
278278
auto set_target_properties = [&](const std::string& device, const ov::AnyMap& config_options) {
279279
for (const auto& [key, value] : config_options) {
280+
// Update the device_config map from the target_config to avoid load_config being overridden
281+
// by the device_config set by the OpenVINO EP.
282+
auto it = device_config.find(key);
283+
if (it != device_config.end()) {
284+
it->second = value;
285+
}
280286
if ((key.find("NPUW") != std::string::npos) ||
281-
((device_config.find(key) != device_config.end()) && session_context_.enable_causallm)) {
287+
((it != device_config.end()) && session_context_.enable_causallm)) {
282288
continue;
283289
}
284290
OVCore::Get()->core.set_property(device, ov::AnyMap{{key, value}});

0 commit comments

Comments
 (0)