fix: respect GGML_METAL=OFF on macOS - #2370
Open
provoke210 wants to merge 1 commit into
Open
provoke210 wants to merge 1 commit into
provoke210 wants to merge 1 commit into
Conversation
Assisted-by: OpenAI Codex Signed-off-by: Haozhe Jiang <162801044+provoke210@users.noreply.github.com>
provoke210
force-pushed
the
fix/respect-macos-metal-option
branch
from
September 22, 2026 07:44
2ca5c8d to
0e61ee9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2050.
On macOS,
-DGGML_METAL=OFFis overwritten by the Apple configuration block: the CMake cache ends up withGGML_METAL:BOOL=ONand the Metal backend is still built. RemoveFORCEfrom that cache assignment so an explicit user setting is preserved while Metal remains enabled by default on both Apple architectures.The embedded Metal library setting is unchanged. This also adds an Unreleased changelog entry.
Validation
Tested on Apple M5 / macOS 26.5 (arm64), Python 3.12.14, CMake 4.4.3, against main
d73664636c2e3b25ce5949a9b85bba690684cdf3and its unchanged llama.cpp submodule5266f24da75dc449bd56cbed7addb9c8e4a6a73e.-DGGML_METAL=OFFproducesGGML_METAL:BOOL=ONand aggml-metaltarget.CMAKE_ARGS="-DGGML_METAL=OFF" CMAKE_BUILD_PARALLEL_LEVEL=6 python -m build --wheel --no-isolation, then installed it into the test environment. An isolated import confirms the installed wheel is used, contains no Metal library, and reportsllama_supports_gpu_offload() == False.HF_HUB_OFFLINE=1 python -I -m pytest -q: 26 passed, including the existing generation, embedding, and recurrent/hybrid cache tests with their downloaded model fixtures.python -m ruff check llama_cpp tests,python -m ruff format --check llama_cpp tests, andgit diff --check: passed.The Metal-enabled configurations were configured but not compiled. Intel macOS, Linux, and Windows execution were not tested locally.
AI assistance: OpenAI Codex assisted with implementation, review, local validation, and this PR description.