Skip to content

Conversation

@sgbihu
Copy link

@sgbihu sgbihu commented Aug 13, 2025

Description

Override the default value with the value in load_config.

  Ort::KeyValuePairs provider_options;
  provider_options.Add("load_config", "{\"GPU\":{\"INFERENCE_PRECISION_HINT\": \"ACCURACY\"}}");

      const std::string option_prefix = OrtSessionOptions::GetProviderOptionPrefix(ep_to_select.c_str());
      std::vector<const char*> keys, values;
      provider_options.GetKeyValuePairs(keys, values);
      for (size_t i = 0, end = keys.size(); i < end; ++i) {
        // add the default value with prefix
        session_options.AddConfigEntry((option_prefix + keys[i]).c_str(), values[i]);
      }

Motivation and Context

The default configure will passed to OpenVINO and will override the configure in load_config.

@mingmingtasd
Copy link

Thanks very much! I verified this PR can fix my issue! @sgbihu

@MayureshV1 MayureshV1 requested review from ankitm3k, Copilot and preetha-intel and removed request for Copilot August 13, 2025 07:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where INFERENCE_PRECISION_HINT configurations from load_config were being overridden by default values set by the OpenVINO execution provider. The change ensures that load_config values take precedence over default configurations.

  • Adds logic to update existing device_config entries with values from target_config before adding new entries
  • Refactors the condition check to reuse the iterator for better performance

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MayureshV1 MayureshV1 self-requested a review August 13, 2025 07:17
Copy link

@MayureshV1 MayureshV1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sgbihu .. Changes look good to me. Can you please port it to ovep::develop

@sgbihu sgbihu changed the base branch from master to ovep-develop August 13, 2025 07:20
@MayureshV1 MayureshV1 merged commit 609dfbf into intel:ovep-develop Aug 13, 2025
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants