Conversion from MLX to CoreML
Is there support for converting MLX models to CoreML?
There's no easy/automated way to do this unfortunately. But we've had to do it quite a bit (mostly for customers who don't want to do this manual/tedious work themselves). Feel free to reach out if you need any support :)
Can you please share some pointers on how to do this? Did you just manually write MIL code, or is there some automation? I'd like to convert Kokoro TTS model to CoreML. I started with the original PyTorch version and hit a wall with a bunch of errors in both trace and export options. Then I tried ONNX version, no luck either. Then I saw a MLX version, which has a bit cleaner implementation and fewer dependencies so I hoped there was a chance there :-)
Kokoro is a cool model because it's super small for its great performance, and I thought it'd be great for the community to have a CoreML version of it so that we can use it in iOS/MacOS apps. Also, there are lots of PyTorch models coming from the research community where the model code is a hodgepodge of data processing, Tensor code, and 3rd party dependencies, and it'd be great to have a real life example of how to deal with all this complexity when converting it to CoreML.
Just sent you an email. Happy to hop on a call :)
@iliasaz as @ismailsalim pointed out there is no automated way to convert from MLX. You would've to write the code to construct the MIL model or use the simplified MLX version to write the PyTorch implementation and then convert it to Core ML.
To rephrase: Are there any plans to add an MLX pipeline along with commonly supported Keras and PyTorch pipelines to coremltools? This would be extremely useful to have as an end to end pipeline (train -> inference -> deploy) on purely Apple silicon (deployment to iOS devices).
Please tell me this is in the works somewhere 👉👈