Skip to content

[NPU] Add support for compiled model release memory#35084

Merged
pereanub merged 3 commits intoopenvinotoolkit:masterfrom
pereanub:release_memory_compiled_model
Apr 3, 2026
Merged

[NPU] Add support for compiled model release memory#35084
pereanub merged 3 commits intoopenvinotoolkit:masterfrom
pereanub:release_memory_compiled_model

Conversation

@pereanub
Copy link
Copy Markdown
Contributor

@pereanub pereanub commented Mar 31, 2026

Details:

  • Add support for compiled model release memory

Tickets:

AI Assistance:

  • AI assistance used: no / yes
  • If yes, summarize how AI was used and what human validation was performed (build/tests/manual checks).

@pereanub pereanub requested review from a team as code owners March 31, 2026 07:58
@github-actions github-actions bot added the category: NPU OpenVINO NPU plugin label Mar 31, 2026
@pereanub pereanub force-pushed the release_memory_compiled_model branch 2 times, most recently from e4143f3 to afefcdc Compare March 31, 2026 09:19
Signed-off-by: Bogdan Pereanu <bogdan.pereanu@intel.com>
@pereanub pereanub force-pushed the release_memory_compiled_model branch from afefcdc to 91ab8e8 Compare March 31, 2026 11:02
Signed-off-by: Bogdan Pereanu <bogdan.pereanu@intel.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds NPU plugin support for CompiledModel::release_memory() by evicting Level Zero graph memory, plus a basic functional test that validates inference can run again after eviction.

Changes:

  • Implement CompiledModel::release_memory() in the NPU plugin and route it to graph-level eviction.
  • Add evict_memory() plumbing through IGraphGraphZeGraphExtWrappers and call Level Zero pfnEvict.
  • Add a functional behavior test that runs inference, calls release_memory(), then runs inference again.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/plugins/intel_npu/tests/functional/behavior/ov_infer_request/compile_and_infer.hpp Adds a regression-style test for release_memory() and a disabled memory-usage check test.
src/plugins/intel_npu/src/plugin/src/compiled_model.cpp Implements CompiledModel::release_memory() by evicting graph memory.
src/plugins/intel_npu/src/plugin/include/compiled_model.hpp Declares release_memory() override on the NPU compiled model.
src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp Adds Level Zero graph eviction wrapper calling pfnEvict.
src/plugins/intel_npu/src/compiler_adapter/src/graph.cpp Adds Graph::evict_memory() forwarding to the ZE wrapper.
src/plugins/intel_npu/src/compiler_adapter/include/ze_graph_ext_wrappers.hpp Declares ZeGraphExtWrappers::evict_memory(...).
src/plugins/intel_npu/src/compiler_adapter/include/graph.hpp Declares Graph::evict_memory() override.
src/plugins/intel_npu/src/common/src/igraph.cpp Adds default IGraph::evict_memory() implementation (currently throwing).
src/plugins/intel_npu/src/common/include/intel_npu/common/igraph.hpp Declares IGraph::evict_memory() in the common interface.

@pereanub pereanub requested a review from Copilot April 1, 2026 08:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Signed-off-by: Bogdan Pereanu <bogdan.pereanu@intel.com>
@pereanub pereanub force-pushed the release_memory_compiled_model branch from 105d931 to 7161335 Compare April 1, 2026 11:24
@pereanub pereanub enabled auto-merge April 3, 2026 05:42
@pereanub pereanub added this pull request to the merge queue Apr 3, 2026
Merged via the queue into openvinotoolkit:master with commit 86b7de0 Apr 3, 2026
179 checks passed
@pereanub pereanub deleted the release_memory_compiled_model branch April 3, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: NPU OpenVINO NPU plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants