OpenVINO: Add support for model caching via 'cache_dir' provider option#1900
Merged
kunal-vaishnavi merged 10 commits intoDec 7, 2025
Merged
Conversation
e80374d to
543742f
Compare
…cache_dir / load_config merging
543742f to
6965774
Compare
kunal-vaishnavi
approved these changes
Dec 5, 2025
apsonawane
pushed a commit
that referenced
this pull request
Dec 19, 2025
…on (#1900) This PR adds support for model caching, to improve 2nd+ load time. It allows the `genai_config.json` to specify a 'cache_dir' provider option (e.g. 'openvino_cache'). When set, it will instruct the OpenVINO EP to create a cache directory within the model folder (by default, unless an absolute path is specified). OpenVINO will save compiled blobs to this directory, and then read on successive runs. This drastically reduces model load time for the 2nd+ runs. This PR moves all OpenVINO-specific provider option handling into a `OpenVINO_AppendProviderOptions` API, provided by `openvino/interface`. The changes in `model.cpp` are mainly to remove all OpenVINO-specific handling that was grouped with the rest of the other EP's, as that's now handled within `OpenVINO_AppendProviderOptions`.
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.
This PR adds support for model caching, to improve 2nd+ load time.
It allows the
genai_config.jsonto specify a 'cache_dir' provider option (e.g. 'openvino_cache'). When set, it will instruct the OpenVINO EP to create a cache directory within the model folder (by default, unless an absolute path is specified). OpenVINO will save compiled blobs to this directory, and then read on successive runs. This drastically reduces model load time for the 2nd+ runs.This PR moves all OpenVINO-specific provider option handling into a
OpenVINO_AppendProviderOptionsAPI, provided byopenvino/interface. The changes inmodel.cppare mainly to remove all OpenVINO-specific handling that was grouped with the rest of the other EP's, as that's now handled withinOpenVINO_AppendProviderOptions.