Skip to content

ggml : report allocation failure from the meta buffer type - #2

Open
Piggidragon wants to merge 3 commits into
llama/devfrom
ggml/meta-alloc-failure
Open

Piggidragon wants to merge 3 commits into
llama/devfrom
ggml/meta-alloc-failure

Conversation

@Piggidragon

Copy link
Copy Markdown
Owner

Overview

ggml_backend_meta_buffer_type_alloc_buffer and ggml_backend_meta_alloc_ctx_tensors_from_buft
asserted 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_fit rely on that to probe how
much 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 GenerelSchwerz#57, which needed the meta backend to survive a failed probe. No behaviour changes
while allocation succeeds.

Testing

test-llama-archs -s 1 with 1, 2, 3 and 4 virtual CUDA devices: passes.
Built with -DLLAMA_FATAL_WARNINGS=ON.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES - implemented by an agent on my instruction, see the commit trailer.

🤖 Generated with Claude Code

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant