[TensorRT EP] Enhance EP context configs in session options and provider options#19154
Merged
[TensorRT EP] Enhance EP context configs in session options and provider options#19154
Conversation
Contributor
Author
|
@jywu-msft @gedoensmax |
gedoensmax
reviewed
Jan 15, 2024
Contributor
gedoensmax
left a comment
There was a problem hiding this comment.
This looks great even including the plugin change son the wrapper and the embed mode warning. Thanks !
Just want to make sure I understand the options order correctly.
jywu-msft
reviewed
Jan 16, 2024
include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h
Outdated
Show resolved
Hide resolved
jywu-msft
reviewed
Jan 18, 2024
jywu-msft
reviewed
Jan 18, 2024
… security purpose
Contributor
Author
|
@jywu-msft @gedoensmax |
jywu-msft
reviewed
Jan 20, 2024
jywu-msft
previously approved these changes
Jan 20, 2024
jywu-msft
previously approved these changes
Jan 20, 2024
Contributor
Author
|
@jywu-msft |
jywu-msft
approved these changes
Jan 21, 2024
YUNQIUGUO
pushed a commit
that referenced
this pull request
Jan 23, 2024
…der options (#19154) Several changes: 1. To align with other EPs' setting of EP context configs in session options, for example [QNN EP](#18877), EP context configs for TRT EP can be configured through: 1. Session Options: `ep.context_enable`, `ep.context_file_path` and `ep.context_embed_mode` 2. Provider Options: `trt_dump_ep_context_model`, `trt_ep_context_file_path` and `trt_dump_ep_context_embed_mode` 3. Above setting has 1:1 mapping and provider options has higher priority over session options. ``` Please note that there are rules for using following context model related provider options: 1. In the case of dumping the context model and loading the context model, for security reason, TRT EP doesn't allow the "ep_cache_context" node attribute of EP context node to be the absolute path or relative path that is outside of context model directory. It means engine cache needs to be in the same directory or sub-directory of context model. 2. In the case of dumping the context model, the engine cache path will be changed to the relative path of context model directory. For example: If "trt_dump_ep_context_model" is enabled and "trt_engine_cache_enable" is enabled, if "trt_ep_context_file_path" is "./context_model_dir", - if "trt_engine_cache_path" is "" -> the engine cache will be saved to "./context_model_dir" - if "trt_engine_cache_path" is "engine_dir" -> the engine cache will be saved to "./context_model_dir/engine_dir" ``` 2. User can decide the naming of the dumped "EP context" model by using `trt_ep_context_file_path`, please see GetCtxModelPath() for more details. 3. Added suggested comments from #18217
Contributor
|
This PR has been cherry-picked into the |
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.
Several changes:
ep.context_enable,ep.context_file_pathandep.context_embed_modetrt_dump_ep_context_model,trt_ep_context_file_pathandtrt_dump_ep_context_embed_modeUser can decide the naming of the dumped "EP context" model by using
trt_ep_context_file_path, please see GetCtxModelPath() for more details.Added suggested comments from [TensorRT EP] Load precompiled TRT engine file directly #18217