Repository navigation
llama : reserve graph nodes for the MoE cache - #32636
Merged
Merged
Conversation
The MoE cache adds a slot lookup to every MoE layer, and with --moe-cache-cpu-share a second expert path, but graph_max_nodes() did not account for it. Models on the default 8*n_tensors budget with few tensors per layer (cohere2moe: 443 tensors, 49 layers) overflow the graph context when the cache is combined with a quantized KV cache (K/V rotation), aborting in ggml_new_tensor with GGML_ASSERT(obj_new). Fixes ggml-org#32584 Assisted-by: Claude Opus 5.5
|
It works. |
ggerganov
approved these changes
Nov 20, 2026
CISC
approved these changes
Nov 20, 2026
Kidplayer666
pushed a commit
to Kidplayer666/llama.cpp
that referenced
this pull request
Nov 20, 2026
The MoE cache adds a slot lookup to every MoE layer, and with --moe-cache-cpu-share a second expert path, but graph_max_nodes() did not account for it. Models on the default 8*n_tensors budget with few tensors per layer (cohere2moe: 443 tensors, 49 layers) overflow the graph context when the cache is combined with a quantized KV cache (K/V rotation), aborting in ggml_new_tensor with GGML_ASSERT(obj_new). Fixes ggml-org#32584 Assisted-by: Claude Opus 5.5
Annieren
pushed a commit
to Annieren/llama.cpp-upstream
that referenced
this pull request
Nov 23, 2026
The MoE cache adds a slot lookup to every MoE layer, and with --moe-cache-cpu-share a second expert path, but graph_max_nodes() did not account for it. Models on the default 8*n_tensors budget with few tensors per layer (cohere2moe: 443 tensors, 49 layers) overflow the graph context when the cache is combined with a quantized KV cache (K/V rotation), aborting in ggml_new_tensor with GGML_ASSERT(obj_new). Fixes ggml-org#32584 Assisted-by: Claude Opus 5.5
Wizard815
pushed a commit
to Wizard815/mx-llama.cpp-Rocm10
that referenced
this pull request
Nov 25, 2026
The MoE cache adds a slot lookup to every MoE layer, and with --moe-cache-cpu-share a second expert path, but graph_max_nodes() did not account for it. Models on the default 8*n_tensors budget with few tensors per layer (cohere2moe: 443 tensors, 49 layers) overflow the graph context when the cache is combined with a quantized KV cache (K/V rotation), aborting in ggml_new_tensor with GGML_ASSERT(obj_new). Fixes ggml-org#32584 Assisted-by: Claude Opus 5.5 (cherry picked from commit 4c4a0f0)
Mr-J-369
pushed a commit
to Mr-J-369/llama.cpp-Android
that referenced
this pull request
Nov 25, 2026
The MoE cache adds a slot lookup to every MoE layer, and with --moe-cache-cpu-share a second expert path, but graph_max_nodes() did not account for it. Models on the default 8*n_tensors budget with few tensors per layer (cohere2moe: 443 tensors, 49 layers) overflow the graph context when the cache is combined with a quantized KV cache (K/V rotation), aborting in ggml_new_tensor with GGML_ASSERT(obj_new). Fixes ggml-org#32584 Assisted-by: Claude Opus 5.5 (cherry picked from commit 4c4a0f0)
twinlunarstarz-dev
pushed a commit
to twinlunarstarz-dev/llama.cpp-optium
that referenced
this pull request
Nov 26, 2026
…lock MMQ guard (ggml-org#32566), Pascal mvq-fusion gate (ggml-org#32239)
Nindaleth
pushed a commit
to Nindaleth/llama.cpp
that referenced
this pull request
Nov 26, 2026
The MoE cache adds a slot lookup to every MoE layer, and with --moe-cache-cpu-share a second expert path, but graph_max_nodes() did not account for it. Models on the default 8*n_tensors budget with few tensors per layer (cohere2moe: 443 tensors, 49 layers) overflow the graph context when the cache is combined with a quantized KV cache (K/V rotation), aborting in ggml_new_tensor with GGML_ASSERT(obj_new). Fixes ggml-org#32584 Assisted-by: Claude Opus 5.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
Fixes #32584.
graph_max_nodes()does not account for the nodes the MoE cache adds to each MoE layer: the slot lookup (plus thesupports_opprobe tensors), and with--moe-cache-cpu-sharea second expert path. Archs on the 32x/64x budgets have enough headroom, but cohere2moe uses the default8*n_tensorsand has few tensors per layer (443 tensors, 49 layers -> 3544). Combined with a quantized KV cache (K/V rotation adds nodes too), the graph context runs out of space:Graph-context tensors used, measured on GB10:
This adds
32*n_layer_allnodes when the MoE cache is enabled. That covers the ~16 tensors per MoE layer of the worst case, with 2x margin.Requirements