local-ai · review · first seen Nov 29, 10:32 UTC
llama.cpp tightens Metal ADD chain fusion checks
llama.cpp b12840 shipped a stricter Metal ADD chain fusion check: all addends must share a backend buffer. Builders whose runs change batch size should check it because the documented difference in fusion and node order can lead to a scheduler reallocation abort.
In short
- b12840 shipped same-backend-buffer checks for Metal ADD chain fusion.
- Reported tests include nemotron_h-dense.gguf and 4- and 16-row verification batches.
- Treat this as a targeted regression check, not a performance claim.
What shipped
The b12840 pre-release changes when Metal may pack the addends in an ADD chain. Sharing a layout is no longer enough; every addend must also share a backend buffer. The requirement applies in both the structural and full checks. This is a shipped eligibility change, not a scheduled change or a claim that ADD chain fusion has been removed. [1]
The release excerpt explains why batch size exposed the issue. A bias add and a residual add share a layout only for single-token batches, but they live in different buffers. Packing those addends, and reordering the following nodes, could therefore depend on ubatch size. The scheduler reserves one graph and aborts on an unexpected reallocation when node order changes. The excerpt gives nemotron_h as an example of that failure path. Requiring a shared buffer keeps this layout-only match out of the fusion check. [1]
The reported tests include test-llama-context with nemotron_h-dense.gguf and GGML_SCHED_DEBUG_REALLOC=1, test-metal-graph-optimize, and test-fusion against tests/fusion/MTL.csv. The excerpt also reports llama-speculative testing on m5-1 at 4- and 16-row verification batches. Those are specific test conditions, not a statement that every model or batch size was covered. The release excerpt supplies this attestation link: https://github.com/ggml-org/llama.cpp/attestations/73540304. [1]
Why it matters if you build
If your workflow changes ubatch size, the point to investigate is continuity of the graph, not an assumed performance gain. In the documented case, a batch-dependent fusion decision changes node order after the scheduler has reserved a graph. An unexpected reallocation then causes an abort. A successful single-token run alone would not test the difference the release note describes. The shared-buffer rule makes eligibility less dependent on the layout match that appears only at that batch shape. [1]
The immediate cost is a targeted regression pass on a relevant workload. The excerpt gives a model file, a scheduler debug setting, named tests, and two verification batch sizes that can anchor that pass. It does not give latency, memory, throughput, or quality measurements. Do not use this change as evidence that a run will become faster or cheaper. If the named model and tests do not represent your workload, your own batch changes remain the more useful check. [1][2]
Keep the scope narrow when interpreting a result. The shipped rule concerns Metal ADD chain fusion and whether addends share a backend buffer. The source does not show that every scheduler abort comes from this path, or that every ADD chain is affected. The 4- and 16-row verification batches are reported test cases, not published limits. A different batch shape still needs its own check before you rely on the change. [1][2]
How to try it today
- Read the b12840 Metal ADD chain fusion note and identify where your workload changes ubatch size.
- If the model file is available, run test-llama-context with nemotron_h-dense.gguf and GGML_SCHED_DEBUG_REALLOC=1.
- Run test-metal-graph-optimize and test-fusion against tests/fusion/MTL.csv.
- Exercise llama-speculative with 4- and 16-row verification batches; check for the documented unexpected-reallocation abort.
- Repeat with your relevant batch changes, and check whether the addends share a backend buffer before attributing a result to this fusion rule.
What we checked
Every claim below was walked down the source ladder. The rung is how close the source is to the thing itself; the tense is the source's own.
-
shipped L0 · primary
llama.cpp b12840 requires all addends in an ADD chain to share a backend buffer in both structural and full checks.
per GitHub releases · ggml-org/llama.cpp (L0) -
shipped L0 · primary
The change was tested with nemotron_h-dense.gguf and 4- and 16-row verification batches.
per GitHub releases · ggml-org/llama.cpp (L0)
What is not confirmed
The supplied evidence does not establish that b12840 prevents this abort for every model, device, graph, or ubatch size. It provides no before-and-after performance figures or failure rates, and it does not establish a change to non-Metal paths. The named tests support a focused evaluation; they are not a universal compatibility guarantee. [1][2]
Who should act, who should wait
Act now if you use Metal with changing batch sizes, particularly if you need to investigate an unexpected scheduler reallocation around an ADD chain. Evaluate b12840 with the named checks and your own workload before depending on it. Wait on a broader adoption decision if you need measured performance gains or evidence for a different model, graph, or batch size. The shipped check addresses a documented fusion condition, while those wider outcomes remain unconfirmed here. [1][2]
Sources
- b12840 — GitHub releases · ggml-org/llama.cpp L0 · primary