ggml : report allocation failure from the meta buffer type - #64
Open
Piggidragon wants to merge 3 commits into
Open
ggml : report allocation failure from the meta buffer type#64Piggidragon wants to merge 3 commits into
Piggidragon wants to merge 3 commits into
Conversation
This was referenced Sep 3, 2026
Owner
|
Automated preliminary review by Codex; the repository owner plans a separate manual review. Verdict: CONDITIONAL PASS. Blocking:
Will slow review:
Nits:
Developmental progress: The broad precursor scope has been reduced to this focused single-file change, and the original dangling-pointer problem is fixed. Unrelated predecessor concerns were split into other PRs. Reviewed head: a18bcdf |
The meta buffer type asserted when a simple buffer could not be allocated, so an out-of-memory condition aborted instead of returning NULL like every other buffer type. Free what was allocated and return NULL. Assisted-by: Claude Opus 5
Assisted-by: Claude Opus 5
Piggidragon
force-pushed
the
ggml/meta-alloc-failure
branch
from
September 6, 2026 06:43
1ccc9cc to
e5bbd44
Compare
Assisted-by: Claude Opus 5
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
ggml_backend_meta_buffer_type_alloc_bufferandggml_backend_meta_alloc_ctx_tensors_from_buftasserted when one of the simple buffers behind the meta buffer could not be allocated. Every other
buffer type returns NULL there, and callers such as
llama_params_fitrely on that to probe howmuch fits. Under split mode tensor an out-of-memory condition aborted the process instead.
Free the buffers already allocated and return NULL. The second function also has to clear the
tensors it already pointed at the buffer it frees.
Split out of #57, which needed the meta backend to survive a failed probe. No behaviour changes
while allocation succeeds.
Testing
test-llama-archs -s 1with 1, 2, 3 and 4 virtual CUDA devices: passes.Built with
-DLLAMA_FATAL_WARNINGS=ON.Requirements