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

Đang mở
#1,107 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, go, macos
Lĩnh vực
backend

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.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).

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của docker/model-runner

Tất cả issue của docker/model-runner

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.