macOS: bump pinned llama.cpp to ≥ b10734 so the Metal tensor API works on M5 (prefill ~2.7× slower today)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 20/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.18B 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).
- Ngôn ngữ chính
- Go
- Star
- 662
- Fork
- 156
- Merge trung bình
- 15 giờ 26 phút
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docker/model-runner
-
NixOS package manager supportĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 43/100
docker/model-runner#1103 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 45/100
docker/model-runner#1100 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
docker/model-runner#1077 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
docker/model-runner#1073 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
docker/model-runner#1063 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của docker/model-runner
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
fluxcd/notification-controller#1441 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
OneBusAway/maglev#2145 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
priority/medium status/ready type/chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
discobox-ai/discobox#1357 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TestPseudoLocaleRemote fails now and then: it types the code before the laptop asks for itCó thể đã có người làm @fzn0x đã nhận hôm nay. Đang mởbug priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
edit_file diff rendering panics on invalid UTF-8 textCó thể đã có người làm @TDnorthgarden đã nhận hôm nay. Đang mởarea/tui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
docker/docker-agent#4955 ·
Maintainer thường phản hồi trong vòng 1 ngày