Skip to content

Stop packaging the unused Apple Metal accelerator from v0.19 - #118

Merged
leehack merged 1 commit into
mainfrom
fix/apple-static-gpu-no-metal-accelerator
Nov 10, 2026
Merged

leehack merged 1 commit into
mainfrom
fix/apple-static-gpu-no-metal-accelerator

Conversation

@leehack

@leehack leehack commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Stops shipping libLiteRtMetalAccelerator on iOS and macOS from v0.19: LiteRT never opens it. Owner side of leehack/llamadart#1798.

Why it is unused. v0.19 LiteRtLm links its GPU accelerator (iOS: GpuMetalAccelerator, ml_drift_metal_accelerator.cc; macOS: GpuWebGpuAccelerator). LiteRT gpu_registry.cc at the pinned dcb657e8 registers the statically linked accelerator first and only searches for shared accelerators when none registered.

Evidence (v0.19.1-2 binaries, Qwen3-0.6B .litertlm, M4 Max):

Slice Payload present Result
macOS hook dir: only libLiteRtLm, Gemma provider, Dawn no Metal, WebGPU accelerator or libLiteRt dylib RegisterAccelerator: name=GPU WebGPU, Statically linked GPU accelerator registered., Dawn backend=Metal, GPU answer 4
iOS simulator (iOS 26.5), C API probe, Frameworks/LiteRtLm.framework only no LiteRtMetalAccelerator.framework name=GPU Metal, Statically linked GPU accelerator registered., delegate_metal.mm: Created a Metal device, GPU answer 42
iOS simulator with LiteRtMetalAccelerator.framework present framework present same logs and answer; DYLD_PRINT_LIBRARIES never loads it

No run logs Attempting to load GPU accelerator.

Change

  • has_prebuilt_apple_metal_accelerator(tag) (false from v0.19) gates packaging: package_upstream_prebuilts skips the Apple Metal prebuilt, ios_dlopen_dependencies drops it, so neither the runtime archives nor the SwiftPM set contain it (no LiteRtMetalAccelerator XCFramework).
  • v0.19 source-built LiteRtLm must contain the static accelerator symbol for its platform, so an upstream change that drops static linkage fails packaging instead of shipping a GPU-less runtime.
  • validate_runtime_artifacts rejects a v0.19 candidate that still carries the Metal payload; required_spm_assets/allowed_spm_assets drop its zip from v0.19. v0.16–v0.18 unchanged.
  • LiteRtLm bytes are unchanged (no build input changes); the iOS framework-path patch stays.

Out of scope, follow-up in llamadart: the macOS libLiteRtWebGpuAccelerator/libLiteRt dylibs and the iOS libLiteRt are also unopened by the GPU path above.

Verification: python3 -m unittest discover -s tools -p 'test_*.py' 450 tests OK (new: prebuilt skip per platform/tag, v0.19 inventories, static-symbol requirement with and without the symbol). Full-matrix PR qualification below; GPU re-qualification of the packaged candidate is done downstream in llamadart.

v0.19 LiteRtLm links its GPU accelerator (ml_drift Metal on iOS, WebGPU on
macOS), and LiteRT registers it before searching for a shared one, so the
prebuilt libLiteRtMetalAccelerator is never opened (llamadart#1798).
Packaging now skips it on iOS and macOS, requires the static accelerator
symbol in LiteRtLm, and rejects a candidate that still ships it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant