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

MLX model support #124

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

MLX model support #124

wants to merge 10 commits into from

Conversation

ZachNagengast
Copy link
Contributor

@ZachNagengast ZachNagengast commented Apr 23, 2024

Draft PR for the early stages of supporting MLX based whisper models directly in WhisperKit. (To be updated)

Initial TODOs:

  • Setup swift package structure
  • MLXFeatureExtractor using FeatureExtracting protocol
  • MLXAudioEncoder inference using AudioEncoding protocol
  • MLXTextDecoder inference using TextDecoding protocol or TextDecoder subclass (research needed)
  • Downloading MLX models (research needed to mix and match model downloads between CoreML and MLX)
  • Loading MLX models with a new model protocol
  • Pipeline allowing mixing CoreML and MLX models
  • Compiling whisperkit-cli optionally with/without MLX Crossing this out for now: whisperkit-cli does not have the same bundle size constraints as the core library
  • CI unit tests for iOS platform using xcodebuild instead of iOS simulator (simulator is not supported for MLX)

@ZachNagengast ZachNagengast marked this pull request as draft April 23, 2024 04:57
ZachNagengast and others added 5 commits April 22, 2024 21:57
* Added MLX feature extractor implementation

* CI fix

* added better multiarray conversion

* CI fix

* CI fix

* fixed `asMLMultiArray` implementation, fixed CI

* update xcode, trigger pr when targeting not main branch

* check if vision os builds

* update watch os version

* conditional watchos compilation

* conditional package.swift

* conditional package.swift

* ci fix

* ci fix

* ci fix

* ci fix

* ci fix

* ci fix

* ci fix

* ci fix

* ci fix

* ci fix

* ci fix

* add other tests targest back

* package.swift cleanup

* general cleanup

* revert to xcode 15.2
* added mlx audio encoder

* fixed model protocols

* removed not needed
@ZachNagengast
Copy link
Contributor Author

@jkrukowski relevant: https://ml-explore.github.io/mlx/build/html/install.html#binary-size-minimization

We'll want to minimize the binary size as much as reasonable for iOS deployment

ZachNagengast and others added 4 commits May 28, 2024 14:34
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.

None yet

2 participants