Skip to content

fix(ios): fallback to ggml Metal GPU when ANE is unavailable#7

Open
Halcao wants to merge 1 commit into
OpenBMB:mainfrom
Halcao:fix/ane-fallback-to-ggml-metal
Open

fix(ios): fallback to ggml Metal GPU when ANE is unavailable#7
Halcao wants to merge 1 commit into
OpenBMB:mainfrom
Halcao:fix/ane-fallback-to-ggml-metal

Conversation

@Halcao
Copy link
Copy Markdown
Collaborator

@Halcao Halcao commented May 11, 2026

Summary

  • V46 model loading now tries CoreML first; if loading fails, automatically retries with ggml Metal GPU.
  • No private APIs, no device blacklists — pure try-then-fallback logic.
  • 1 file changed, +17 / -6 lines.

Background

On some devices (e.g. iPhone 17 with iOS 26.x), CoreML fails to load or silently falls back to CPU, causing ViT inference to take ~47s. The ggml Metal GPU path handles the same inference in ~3s.

Test Plan

  • Device where CoreML works (e.g. iPhone 17 Pro): verify CoreML loads and is used
  • Device where CoreML fails (e.g. iPhone 17 iOS 26.x): verify fallback to ggml Metal GPU
  • Device without CoreML model downloaded: verify fallback works

@Halcao Halcao force-pushed the fix/ane-fallback-to-ggml-metal branch from 1735b4d to 11c0a82 Compare May 11, 2026 08:04
Try loading V46 model with CoreML first. If CoreML is unavailable or
loading fails, automatically retry without CoreML to use ggml Metal GPU.
No private APIs, no device blacklists — pure try-then-fallback logic.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Halcao Halcao force-pushed the fix/ane-fallback-to-ggml-metal branch from 11c0a82 to 1a82263 Compare May 11, 2026 08:08
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