Skip to content

OpenVINO: Add support for model caching via 'cache_dir' provider option#1900

Merged
kunal-vaishnavi merged 10 commits into
microsoft:mainfrom
RyanMetcalfeInt8:openvino_caching
Dec 7, 2025
Merged

OpenVINO: Add support for model caching via 'cache_dir' provider option#1900
kunal-vaishnavi merged 10 commits into
microsoft:mainfrom
RyanMetcalfeInt8:openvino_caching

Conversation

@RyanMetcalfeInt8
Copy link
Copy Markdown
Contributor

@RyanMetcalfeInt8 RyanMetcalfeInt8 commented Dec 2, 2025

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.

Comment thread src/openvino/interface.cpp
@kunal-vaishnavi kunal-vaishnavi merged commit 569a9f9 into microsoft:main Dec 7, 2025
15 checks passed
@natke natke added the 0.11.5 label Dec 17, 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`.
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