Skip to content

b12840

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 28 Nov 21:38
115deee

metal : keep ADD chain fusion independent of batch size (#33217)

The ADD chain fusion packs the addends only when they share a layout and a backend buffer. A bias add and a residual add share a layout only for single-token batches, and live in different buffers, so the packing and the following node reorder depend on the ubatch size. The scheduler reserves one graph and aborts on an unexpected reallocation when the node order changes, for example with nemotron_h.

Require all addends in a chain to live in the same backend buffer in both the structural and the full checks.

Tested with test-llama-context (nemotron_h-dense.gguf, GGML_SCHED_DEBUG_REALLOC=1), test-metal-graph-optimize, test-fusion against tests/fusion/MTL.csv, and llama-speculative on m5-1 at 4- and 16-row verification batches.

Assisted-by: dsh:llama.cpp/ggml-org/DeepSeek-V4.1-Flash-1017-GGUF (Mac Studio, M5 Ultra, 256GB)

Co-authored-by: Niklas Wenzel dev@nikwen.de

Website:

Attestations:

macOS/iOS:

Linux:

Android:

Windows:

openEuler:

  • DISABLED
  • openEuler x86 (310p)
  • openEuler x86 (910b, ACL Graph)
  • openEuler aarch64 (310p)
  • openEuler aarch64 (910b, ACL Graph)

UI: