Skip to content

Instantly share code, notes, and snippets.

@jrepp
Created April 27, 2026 22:13
Show Gist options
  • Select an option

  • Save jrepp/140a79ec3496795ed26a9a3883b90d23 to your computer and use it in GitHub Desktop.

Select an option

Save jrepp/140a79ec3496795ed26a9a3883b90d23 to your computer and use it in GitHub Desktop.
llama.cpp release build performance benchmarks on Apple M5 Max

llama.cpp Release Build Report

Date: 2026-04-12 Host: Apple M5 Max Repo commit: ff5ef8278

Final build

The final recommended build is in build-final.

Configuration:

  • CMAKE_BUILD_TYPE=Release
  • GGML_LTO=ON
  • GGML_BLAS=ON
  • GGML_BLAS_VENDOR=Apple
  • GGML_METAL=ON
  • GGML_METAL_NDEBUG=OFF
  • GGML_NATIVE=ON
  • GGML_OPENMP_ENABLED=OFF

Benchmark findings

Benchmark model:

  • Ollama mistral:7b
  • GGUF blob: /Users/jrepp/.ollama/models/blobs/sha256-f5074b1221da0f5a2910d33b642efa5b9eb58cfdddca1c79e16d7ad28aa2b31f

Benchmark mode:

  • llama-bench
  • device: MTL0
  • GPU offload: -ngl 99

Prompt processing benchmark (-p 512 -n 0):

Build Avg tokens/sec
stock build/ 2126.74
build-lto/ 2116.55
build-metalndebug/ 1415.58
build-openmp/ 1517.08
full tuned build-tuned/ 1540.61
final build-final/ 2118.91

Generation benchmark (-p 0 -n 128):

Build Avg tokens/sec
stock build/ 100.56
build-openmp/ 99.57
build-metalndebug/ 99.48
full tuned build-tuned/ 86.32

Conclusions:

  • GGML_LTO=ON is safe on this machine.
  • GGML_METAL_NDEBUG=ON should be avoided for Metal-backed inference here.
  • OpenMP should be avoided for this Metal-backed build here.
  • The final build-final/ build preserves stock-level Metal performance while keeping LTO.

Validation

The final build completed successfully and these commands ran successfully:

  • build-final/bin/llama-cli --help
  • build-final/bin/llama-server --help
  • build-final/bin/llama-bench -m <mistral_blob> --device MTL0 -ngl 99 -p 512 -n 0 -r 3 -o json

Notes

  • Sandboxed runs could not access Metal correctly on this machine. Metal benchmarks only worked outside the sandbox.
  • Existing Jinja-related compiler warnings are still present in the repo, but there were no build failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment