You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Eval bug: Metal BF16 shader fails to compile on macOS 15.5: invalid constexpr #31337
macOS 15.5 (24F74) and your Mac’s chip.
llama.cpp commit 5220213.
Model: LiquidAI LFM3-1.7B-BF16.gguf.
error: constexpr function never produces a constant expression
[-Winvalid-constexpr]
ggml_metal_init: error: failed to initialize the Metal library
Workaround tested: Removed constexpr from the two bfloat4 conversion specializations, keeping inline and both function bodies unchanged. Rebuilt llama-server.
Result: The model loaded with Metal and successfully generated READY in a short inference test.
Operating systems
Mac
GGML backends
Metal
Hardware
Model | MacBook Pro (Mac14,9)
Chip | Apple M2 Pro
CPU | 10 cores: 6 performance + 4 efficiency
GPU | 16 cores, Metal supported
Memory | 16 GB unified memory
Architecture | ARM64 / Apple Silicon
macOS | 15.5 (24F74)
Models
LiquidAI/LFM3-1.7B-GGUF
Problem description & steps to reproduce
Failure: Loading the model failed while compiling the Metal shader:
error: constexpr function never produces a constant expression
[-Winvalid-constexpr]
ggml_metal_init: error: failed to initialize the Metal library
First Bad Commit
No response
Relevant log output
Logs
constexpr function never produces a constant expression[-Winvalid-constexpr]inline constexpr bfloat4ggml_metal_unary_cast<bfloat4, float4>(float4 x)ggml_metal_init: error: failed to initialize the Metal library
Activity
o7si commentedon Oct 29, 2026
Similar to #31272.
llama.cpp 0.8.0 (#58)