macOS: bump pinned llama.cpp to ≥ b10734 so the Metal tensor API works on M5 (prefill ~2.7× slower today)

Offen
#1,107 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
20/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
docker, go, macos
Bereich
backend

Rechercherichtung

The version pin lives in pkg/inference/backends/llamacpp/download.go (pinnedServerVersion) and the .versions file; the upstream fix is ggml-org/llama.cpp#27461, shipped in b10734. Confirm the newest published docker/docker-model-backend-llamacpp Metal tag is at or above b10734, since the bump depends on that build existing. Done means the pin is updated and the M5 log no longer shows the tensor-API disabled warning, which likely needs a maintainer to publish the build.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Title: macOS: bump pinned llama.cpp to ≥ b10734 so the Metal tensor API works on M5 (prefill ~2.7× slower today)

Summary

On Apple M5 hosts, Docker Model Runner's pinned llama.cpp (b9879-metal) fails to enable the Metal tensor API (GPU Neural Accelerators) and falls back to the general-purpose shader path. Prompt processing runs at roughly ⅓ of what the same model file achieves with a current llama.cpp build on the same machine.

This is upstream llama.cpp issue ggml-org/llama.cpp#27473: the runtime Metal compile never sets MTLCompileOptions.languageVersion to 4.0, so the tensor-API probe fails with use of undeclared identifier 'mpp'. It was fixed in ggml-org/llama.cpp#27461, released in b10734.

#1104 bumps the vendored llama.cpp submodule to b12211, but pinnedServerVersion in pkg/inference/backends/llamacpp/download.go (and .versions) is still b9879. The newest Metal tag on docker/docker-model-backend-llamacpp is b9879-metal (latest-metal is older), so LLAMA_SERVER_VERSION cannot be used as a workaround.

Environment
  • Apple M5 Pro (16-core GPU), 48 GB, macOS 27.2.1
  • Docker Desktop 4.98.0, Docker Model Runner v1.2.9
  • Backend: llama.cpp b9879-metal (sha256:b70706f473b4043ca3e0c32704a7fda3412b83bceef0564684187b8011230de8), build 1 (72874f5) with AppleClang 17.0.0.17000013
  • Model: ai/llama3.1 8B Q4_K_M (sha256:c2d45031ad77…)
Observed

On every model load, ~/Library/Containers/com.docker.docker/Data/log/host/inference-llama.cpp-server.log:

E ggml_metal_library_init_from_source: error compiling source
W ggml_metal_device_init: - the tensor API is not supported in this environment - disabling
Measurements (same GGUF file, same host)

llama-bench -b 2048 -ub 2048 with Homebrew llama.cpp (build 12359, b1b770d90) against the GGUF in ~/.docker/models/bundles/sha256/c2d45031…/model/model.gguf, with DMR idle:

Test Native, tensor API on Native, GGML_METAL_TENSOR_DISABLE=1 DMR b9879-metal (server log)
Prefill, 2,048 tokens 1,055 tok/s 385 tok/s ~380 tok/s
Prefill, 7,168 tokens 905 tok/s 346 tok/s —
Decode, 128 tokens 55 tok/s — ~52–55 tok/s

Disabling the tensor API on the current build reproduces DMR's numbers exactly, so the gap is the tensor API alone.

End to end, on a prompt-heavy summarization workload (OpenAI-compatible /chat/completions, ~10:1 prompt:completion tokens), swapping DMR for a tensor-enabled llama-server serving the same GGUF with the same slot layout (-c 32768 -np 4 -kvu) cut wall time 1.49× at 1 concurrent request and 1.64× at 4.

Request

Publish a docker/docker-model-backend-llamacpp Metal build at ≥ b10734 and bump pinnedServerVersion so Docker Desktop on M5 picks it up. Pre-M5 Apple Silicon is unaffected (ggml disables the tensor path by chip name on those devices).

Vorherrschende Sprache
Go
Sterne
662
Forks
156
Ø Merge
15 Std. 26 Min.
Gemergte PRs (30 T.)
17

Entwicklungsumgebung

  • Enthält ein Dockerfile oder eine Docker-Compose-Datei
  • Keine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus docker/model-runner

Alle Issues in docker/model-runner

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.