Repository navigation
TP: fix entirely zero-sized slices per device - #23525
Merged
JohannesGaessler merged 1 commit intoMay 24, 2026
Merged
Conversation
ggerganov
approved these changes
May 23, 2026
nonml
pushed a commit
to nonml/llama.cpp
that referenced
this pull request
May 24, 2026
spiritbuun
referenced
this pull request
in spiritbuun/buun-llama-cpp
May 25, 2026
turbo-tan
pushed a commit
to turbo-tan/llama.cpp-tq3
that referenced
this pull request
Jun 2, 2026
zommiommy
pushed a commit
to zommiommy/llama.cpp
that referenced
this pull request
Aug 18, 2026
zbrad
pushed a commit
to zbrad/llama.cpp
that referenced
this pull request
Sep 10, 2026
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.
Context: I was contacted by @am17an on an off-site communication channel about Qwen 3.6 MTP failing on 3+ GPUs with
-sm tensor.The problem on master is that with MTP the meta backend is allocating a buffer for at least one GPU based on a
ggml_contextwhere all contained tensors are zero-sized. The code inggml-alloc.cends up returningNULLfor this edge case because it never needs to allocate any tensors at all which to it looks like all tensors are already allocated.In the meta backend I think the correct way to handle this is to allocate a dummy buffer for the zero-sized tensors. I am not 100% sure what the correct behavior for
ggml-alloc.cshould be though. In this PR I've kept the behavior as-is (but documented it): for aggml_contextwhere all tensors are already allocated or zero-sized return NULL rather than a dummy buffer.I would like to have this issue fixed on master before #22616 to avoid a situation where a fix is made relative to broken code.
Requirements