Add GGML_OPENVINO_ENABLE_WEIGHT_RELEASE env variable for GPU plugin - #265
Closed
zhaixuejun1993 wants to merge 1 commit into
Closed
Add GGML_OPENVINO_ENABLE_WEIGHT_RELEASE env variable for GPU plugin#265zhaixuejun1993 wants to merge 1 commit into
zhaixuejun1993 wants to merge 1 commit into
Conversation
…E to enable const node weight release for GPU plugin
zhaixuejun1993
requested review from
cavusmustafa,
ravi9,
wine99 and
ynimmaga
and removed request for
cavusmustafa and
wine99
July 29, 2026 08:44
Collaborator
Author
|
replaced by #275 |
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 pull request introduces a mechanism for releasing (freeing) host memory used for OpenVINO model weights after the model has been compiled and cached, primarily to reduce memory usage in long-running processes. The changes add tracking and statistics for weight buffers, carefully manage when and how host memory can be released, and ensure that attempts to reuse or rebuild graphs after release are properly guarded. Additionally, new environment variables and logging are included to control and monitor this feature.

The most important changes are:
OpenVINO Weight Release Mechanism:
RELEASED_WEIGHT) and statistics structures, and a mechanism to safely free memory and prevent further use. (ggml-openvino/ggml-openvino.cpp,ggml-openvino/ggml-openvino-extra.h,ggml-openvino/ggml-decoder.cpp) [1] [2] [3] [4]Runtime Context and Safety Guards:
ggml-openvino/utils.cpp) [1] [2] [3]APIs and Logging:
ggml-openvino/ggml-decoder.h,ggml-openvino/ggml-openvino-extra.h,ggml-openvino/ggml-openvino-extra.cpp,ggml-openvino/utils.cpp) [1] [2] [3] [4]Code Structure and Integration:
ggml-openvino/ggml-openvino.cpp) [1] [2] [3]Safety and Error Handling:
ggml-openvino/ggml-decoder.cpp)These changes together enable significant memory savings for OpenVINO graph execution, especially on GPU, while maintaining safety and debuggability.…E to enable const node weight release for GPU plugin
Overview
Additional information
Requirements