Repository navigation
openvino : report the device allocation limit to ggml - #29124
Closed
lslusarczyk wants to merge 1 commit into
Closed
lslusarczyk wants to merge 1 commit into
lslusarczyk wants to merge 1 commit into
Conversation
OpenVINO reported no GPU allocation limit to ggml, so a single buffer for the whole kvcache was always used. A GPU caps the size of a single memory object and a model could fail to load if the context was too large (e.g. on an iGPU with a 4 GiB cap). With the real limit ggml splits the buffer and large contexts work. Assisted-by: Claude Opus 5
lslusarczyk
marked this pull request as ready for review
September 21, 2026 11:17
Contributor
|
LGTM. I will trigger CI once the self-hosted machine for the OV CI is back online. cc @ravi9 |
wine99
approved these changes
Sep 24, 2026
Contributor
Author
|
This change was cherry-picked and merged into dev_backend_openvino branch by this PR ravi9#256. The change will be incorporated into llama.cpp master together with other changes in dev_backend_openvino branch, therefore I'm closing this PR. |
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.
Overview
OpenVINO reported no GPU allocation limit to ggml, so a single buffer for the whole kvcache was always used. A GPU caps the size of a single memory object and a model could fail to load if the context was too large (e.g. on an iGPU with a 4 GiB cap). With the real limit ggml splits the buffer and large contexts work.
Fixes #29087. See that issue for more details including reproduction steps.
Implementation details
The real limit is taken by getting the
CL_DEVICE_MAX_MEM_ALLOC_SIZEproperty from aclGetDeviceInfocall once at GPU initialization phase. In case of failed query - oldunlimitedvalue is used as fallback, which is the same as previous behavior ensuring no regression.Verification
Checked that all models mentioned in the issue as failing with large enough contexts now pass on my iGPU (UHD Graphics 770)
The path on dGPU (Intel Arc Pro B70) has much larger limit (~30GiB). The code works as before in this path:
alloc_tensor_rangeuses one allocation because kvcaches are below larger limit.Executing on CPU doesn't enter this code at all as before - unlimited value is used.
Requirements