Repository navigation
[0.17.1] Fix Metal on iOS and macOS before 26; check kernels on the oldest OS - #153
Merged
Merged
Conversation
ggml compiles embedded Metal source on the user's device with that OS's compiler, so a build on a current runner cannot see a kernel that older OS versions reject. This check is expected to fail until the unary kernels are repaired: v0.8.0 fails on macOS 14 and 15.
A simulator runtime brings its iOS version's Metal compiler: iOS 17 and 18 reject the v0.8.0 unary kernel as the devices do, on the same host where iOS 26 accepts it. macOS 14 runners have no default Metal device; ggml falls back to MTLCopyAllDevices there, and so does this check.
Extracting the embedded kernels misses what the loader does to them, and a runner's paravirtual device reports no bfloat, so loading on it skips the kernel that fails. This loads the backend from the dylib with the bfloat families reported. Expected red on macOS 14 and 15 and on the iOS 17 and 18 simulators until the unary kernel is repaired.
llama.cpp #31146 made the bfloat4 specializations of ggml_metal_unary_cast constexpr. Metal compilers before iOS and macOS 26 reject the vector subscript in one of them, so Metal fails to initialize on devices with bfloat. Upstream #31360 drops constexpr and is in no stable release. A patch cannot edit a .metal file, so 0004 makes the same edit to the embedded source as ggml loads it. Patches of Apple-only sources get apple_markers, checked on Apple bundles, and upstream_fix_path, because the upstream fix is in another file. The release gates on metal_os_floor.yml.
This was referenced Oct 31, 2026
GitHub retires macos-14 by 2026-11-02, and the floor gates releases, so it moves to macos-15, macos-26 and the oldest iOS simulator on macos-15. macOS 14 and iOS 17 stay as recorded one-time results; macOS 13 and iOS 16 are disclosed as uncovered. The provenance verifier now honors upstream_fix_path and pins the floor: the check-apple step, the --bf16 runs, and no way to turn a job off or let it fail. A required_text entry makes patch 0004 not fit when the text its runtime edit needs is gone, since its marker cannot show that. check-apple fails on a bundle without the library, and --bf16 fails unless ggml logs that it has bfloat.
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 #154 and #155. Metal initializes on iOS and macOS before 26 again, and a new check keeps it that way. Needed for a
v0.8.0-1rebuild; blocks leehack/llamadart#1645.Policy exception for the maintainer: this carries a llama.cpp patch. Upstream #31360 has the fix but no stable release does.
Changes
ggml-metal-device.mat load, because a patch cannot change a.metalfile (patches/llama.cpp/README.md). It retires when the pinned upstream has #31360.metal_os_floor.ymlloads the backend through ggml's loader onmacos-15,macos-26and the oldest iOS simulator onmacos-15. It reports the bfloat GPU families, since a runner's paravirtual device reports family Apple5 and no bfloat and so skips the failing code. It also gatesnative_release.yml.apple_markers,upstream_fix_pathandrequired_textextend the patch series for Apple-only sources and for an edit whose own literal cannot show it matched.verify_release_provenance.pyhonorsupstream_fix_pathand pins the floor: thecheck-applestep, the--bf16runs, and no way to turn a job off or let it fail.Evidence
cf5cbbc)cd9043a, before the runner move)autoand explicit, 25/25 layersautoand explicitFirebase used the 0.17.1 XCTest bundles with only
llama.framework/llamareplaced by a local v0.8.0 plus 0004 build. Validation results match the same case list as 0.17.0;C06.historyfails on capitalization in every run, CPU and 0.17.0 included.macOS 14 and iOS 17 are one-time results: GitHub retires
macos-14by 2026-11-02, so the gate no longer runs them.Not covered: macOS 13, below the 14.0 companion floor though the dylib's minimum is 13.3, and iOS 16. No runner has iOS 16, and Firebase's iPhone 14 Pro iOS 16.6 reports an asset issue before the test starts, with or without this change.
No release is dispatched here.