Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Silicone Neural Engine: Core ML model package format #1889

Closed
qdrddr opened this issue Apr 25, 2024 · 6 comments
Closed

Apple Silicone Neural Engine: Core ML model package format #1889

qdrddr opened this issue Apr 25, 2024 · 6 comments
Labels

Comments

@qdrddr
Copy link

qdrddr commented Apr 25, 2024

Is your feature request related to a problem? Please describe.

Please consider adding Core ML model package format support to utilize Apple Silicone Nural Engine + GPU.

Describe the solution you'd like
Utilize both ANE & GPU, not just GPU on Apple Silicon

Describe alternatives you've considered
Currently can use only GPU

Additional context
List of Core ML package format models

https://github.com/likedan/Awesome-CoreML-Models

@qdrddr
Copy link
Author

qdrddr commented Apr 25, 2024

This is about running LLMs locally on Apple Silicone. Core ML is a framework that can redistribute workload across CPU, GPU & Nural Engine (ANE). ANE is available on all modern Apple Devices: iPhones & Macs (A14 or newer and M1 or newer). Ideally, we want to run LLMs on ANE only as it has optimizations for running ML tasks compared to GPU. Apple claims "deploying your Transformer models on Apple devices with an A14 or newer and M1 or newer chip to achieve up to 10 times faster and 14 times lower peak memory consumption compared to baseline implementations".

  1. To utilize Core ML first, you need to convert a model from TensorFlow, PyTorch to Core ML model package format using coremltools (or simply utilize existing models in Core ML package format ).
  2. Second, you must now use that converted package with an implementation designed for Apple Devices. Here is the Apple XCode reference PyTorch implementation.

https://machinelearning.apple.com/research/neural-engine-transformers

@qdrddr
Copy link
Author

qdrddr commented Apr 25, 2024

Work in progress on CoreML implementation for [whisper.cpp]. They see x3 performance improvements for some models. (ggerganov/whisper.cpp#548) you might be interested in.

Here is another implementation Swift Transformers you might also be interested in.
Example of CoreML application
https://github.com/huggingface/swift-chat

@qdrddr qdrddr changed the title Apple Silicone Nural Engine: Core ML model package format Apple Silicone Neural Engine: Core ML model package format Apr 26, 2024
Copy link

github-actions bot commented May 4, 2024

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

@github-actions github-actions bot added the stale label May 4, 2024
@qdrddr
Copy link
Author

qdrddr commented May 4, 2024

Hope it's not closed/ forgotten

@github-actions github-actions bot removed the stale label May 5, 2024
Copy link

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

@github-actions github-actions bot added the stale label May 12, 2024
Copy link

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant