Modified Create Options to pass config options to execution Provider#448
Merged
sfatimar merged 2 commits intoovep-develop-lnl-1.2from Sep 23, 2024
Merged
Conversation
ankitm3k
reviewed
Sep 23, 2024
|
|
||
| std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory(const void* void_params) override { | ||
| auto& provider_options_map = *reinterpret_cast<const ProviderOptions*>(void_params); | ||
| typedef std::pair<const ProviderOptions*, const ConfigOptions&> buffer_t; |
There was a problem hiding this comment.
Suggested change
| typedef std::pair<const ProviderOptions*, const ConfigOptions&> buffer_t; | |
| typedef std::pair<const ProviderOptions*, const ConfigOptions&> ConfigBuffer; |
typedef naming case must be similar to the case of a class as the return type creates confusion whether the its a variable or a type while reading.
There was a problem hiding this comment.
Below can optimally look like -
const ConfigBuffer* buffer = reinterpret_cast<const ConfigBuffer*>(void_params);
ankitm3k
reviewed
Sep 23, 2024
| // Add new provider option below | ||
| ov_options_converted_map["num_streams"] = "1"; | ||
| ov_options_converted_map["export_ep_ctx_blob"] = "false"; | ||
| //ov_options_converted_map["export_ep_ctx_blob"] = "false"; |
ankitm3k
reviewed
Sep 23, 2024
| onnxruntime::ORTSessionOptionsToOrtOpenVINOProviderOptions(*provider_options_map, session_options); | ||
| } | ||
| return s_library_openvino.Get().CreateExecutionProviderFactory(provider_options_map); | ||
| std::pair<const ProviderOptions*, const ConfigOptions&> buffer = {provider_options_map, session_options->config_options}; |
There was a problem hiding this comment.
Suggested change
| std::pair<const ProviderOptions*, const ConfigOptions&> buffer = {provider_options_map, session_options->config_options}; | |
| std::pair<const ProviderOptions*, const ConfigOptions&> config_buffer = {provider_options_map, session_options->config_options}; |
buffer as a variable name can carry many assumptions like memory, registers, cache etc. Its better to use above for clarity
ankitm3k
reviewed
Sep 23, 2024
| return s_library_openvino.Get().CreateExecutionProviderFactory(provider_options_map); | ||
| std::pair<const ProviderOptions*, const ConfigOptions&> buffer = {provider_options_map, session_options->config_options}; | ||
| const void* obj = reinterpret_cast<const void*>(&buffer); | ||
| return s_library_openvino.Get().CreateExecutionProviderFactory(obj); |
There was a problem hiding this comment.
Optional
Suggested change
| return s_library_openvino.Get().CreateExecutionProviderFactory(obj); | |
| return s_library_openvino.Get().CreateExecutionProviderFactory(reinterpret_cast<const void*>(&config_buffer)); |
ankitm3k
reviewed
Sep 23, 2024
ankitm3k
left a comment
There was a problem hiding this comment.
Please fix the lint issues additionally.
Author
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Create Passes in a single buffer ProviderOptions and SessionOptions Config to the
The Factory Creator which stores the reference to config and when createprovider is invoked
same reference is used to get config options
Motivation and Context