Repository navigation
meta: recreate all subgraphs when the arena is reallocated - #30453
Merged
Merged
Conversation
Xanewok
force-pushed
the
fix/meta-subgraph-realloc
branch
from
October 13, 2026 13:40
9bb2335 to
fddebd3
Compare
JohannesGaessler
approved these changes
Oct 13, 2026
JohannesGaessler
left a comment
Contributor
There was a problem hiding this comment.
Thank you, I presumably made a mistake when refactoring and this is the correct fix. My opinion is that the new expected value of the new test case is too low in terms of catching such mistakes in the future so it should be stripped from the PR. (Unless @ggerganov disagrees?)
ggerganov
approved these changes
Oct 13, 2026
Contributor
Author
Yeah, that's a fair point - I've removed them in 44035c4. Thank you guys for such a quick turnaround! |
Member
|
@Xanewok What is the impact on normal uses? Does this patch prevent crashes in some cases? |
Contributor
Author
|
@ggerganov thankfully I didn't hit this myself in stock/master setup, no; only in some local experiments so far |
1 task done
edwardyoon
pushed a commit
to edwardyoon/focus-llama
that referenced
this pull request
Oct 24, 2026
…30453) * meta: recreate all subgraphs when the arena is reallocated * chore: revert added test cases
MuFengMuXue
pushed a commit
to MuFengMuXue/llama.cpp-gfx906
that referenced
this pull request
Oct 25, 2026
Brings the fork from upstream b11553 to the v0.7.0 release (116 upstream commits). Every fork feature is kept; where both sides changed the same code the two changes are combined, not chosen between. Textual conflicts (10 hunks, 8 files): - common/speculative.cpp: upstream's LiliCorr setup (ggml-org#30506) placed ahead of the fork's fallback to the target vocab's mask token. - ggml/src/ggml-backend-meta.cpp: upstream's subgraph recreation (ggml-org#30453) is the fork's own fix; the fork's comment is kept. - ggml/src/ggml-cuda/common.cuh: the fork's context fields kept, with upstream's `= {}` initializers for the stream and cuBLAS arrays. - ggml/src/ggml-cuda/gated_delta_net.cu: includes both the fork's chunk kernel header and upstream's MMA header. - src/llama-context.cpp: both call sites use upstream's sched_new() member (it adds the graph realloc callback, ggml-org#30329); the fork's sync-non-graph-inputs policy moves into it. - src/llama-ext.h: the fork's MTP prefill and pre-norm accumulation declarations kept, upstream's wording for the decision head comment. - src/llama-model.cpp: the fork's skip for contexts with nothing to allocate kept without the per-file buffer map that upstream removed (ggml-org#30405); load_tensors() ends with upstream's load_tensors_hadamard() and then the fork's PLE prefault. - tools/server/server-context.cpp: release() resets the speculative state as the fork does and also drops the prompt of stateless tasks as upstream does. Merged without a textual conflict but changed here: - common/speculative.cpp: LiliCorr stores the projected rows of each inject in the eager path only. The fork's deferred prompt encode replays the injects in flush_pending_upto() without that step, so a LiliCorr drafter stays on the eager path. - ggml/src/ggml-cuda/gated_delta_net.cu: upstream's MMA chunked kernel (ggml-org#29353) writes only the final state. When the fork's snapshot ring keeps more than one state (K > 1) the call goes to the fork's kernels. On HIP the MMA path runs on RDNA3.5 only, so gfx906 does not take it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
While I looked how to speed up running 2x5060 Ti via
-sm tensor, I hit a segfault while trying some local experiment for Qwen3.8 and discovered that we:max_nnodes_raisedtriggers orcgraph->n_nodes < max_nnodes(with added graph of more subgraphs but fewer nodes)And so a later graph within both max values (
max_subgraphs,max_nnodes) skips reallocation and uses freed subgraph or overflows a small one.Added test to test-alloc.cpp but can separate a meta backend-specific one if desired?
Requirements