Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenVINO]Session Options Appended After AppendExecutionProvider #23852

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sfatimar
Copy link
Contributor

Description
To honor SessionOption API Contract the ordering of AddConfigOption and AppendExecutionProvider_OpenVINO should not matter. This PR is fixing that issue

Motivation and Context
This PR fixes a regression happened during last PR in ordering of SessionOptions.

config_options = &session_options->config_options;
}

std::array<const void*, 2> configs_array = {provider_options_map, config_options};
Copy link
Contributor

Choose a reason for hiding this comment

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

how about declare a struct type?

struct OpenVINOProviderFactoryCreateParams {
  const ProviderOptions* provider_options_map;
  const ConfigOptions* config_options;
};

This would be much easier to read

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@fs-eire fs-eire left a comment

Choose a reason for hiding this comment

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

Please run the code linter/formatter and also revise the title of the PR.

@sfatimar sfatimar changed the title Sahar/session options [OpenVINO]Session Options Appended After AppendExecutionProvider Mar 3, 2025
@sfatimar
Copy link
Contributor Author

sfatimar commented Mar 4, 2025

@fs-eire Please comment.

@jywu-msft jywu-msft requested a review from yihonglyu March 4, 2025 05:43
@yihonglyu
Copy link
Contributor

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, Linux OpenVINO CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, Linux QNN CI Pipeline

Copy link

Azure Pipelines successfully started running 9 pipeline(s).

@@ -101,6 +101,7 @@ struct ProviderInfo {
bool so_context_embed_mode{false}; // ORT session option
bool so_share_ep_contexts{false}; // ORT session option
fs::path so_context_file_path{}; // ORT session option
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it expected that so_context_file_path and cache_dir use different initializer values?

Copy link

@MayureshV1 MayureshV1 Mar 5, 2025

Choose a reason for hiding this comment

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

@yihonglyu , Yes cache_dir refers to OV caching and so_context_file_path is used when ORT caching (so_context_enable) is set.

Though there is no benefit of enabling both simultaneously, it can be enabled and can have different values.
Cache_DIR points to a directory and so_context_file_path points to a EP Ctx file name.

@yihonglyu
Copy link
Contributor

/azp run Linux CPU CI Pipeline, Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline, Linux GPU TensorRT CI Pipeline, Linux OpenVINO CI Pipeline, MacOS CI Pipeline, ONNX Runtime Web CI Pipeline, onnxruntime-binary-size-checks-ci-pipeline, Linux QNN CI Pipeline

Copy link

Azure Pipelines successfully started running 9 pipeline(s).

@yihonglyu
Copy link
Contributor

/azp run Linux CPU Minimal Build E2E CI Pipeline, Linux GPU CI Pipeline

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

}

std::array<void*, 2> pointers_array = *reinterpret_cast<const std::array<void*, 2>*>(void_params);
const ProviderOptions provider_options = *reinterpret_cast<ProviderOptions*>(pointers_array[0]);
Copy link
Contributor

Choose a reason for hiding this comment

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

in latest commit, this line changed to make a copy of the ProviderOptions object. Is this done intentionally?

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.

4 participants