coreml : revisit instructions and model generation scripts · Issue #2783 · ggml-org/whisper.cpp · GitHub
Skip to content

coreml : revisit instructions and model generation scripts #2783

Closed

Description

@ggerganov

The CoreML creation process has been flaky from the very beginning (#566), mainly because the python packages were not compatible with each other. Things likely have changed since the initial support was added and hopefully are more stable now.

  • Update CoreML model conversion/creation instructions
  • Add CI workflows to exercise CoreML conversion (can utilize ggml-ci for Apple Silicon nodes)

Activity

  1. added
    buildBuild related issues
    documentationImprovements or additions to documentation
    roadmapPart of a roadmap project
    on Feb 4, 2025
  2. furqan4545 commented on Mar 17, 2025

    @furqan4545

    how to integrate .mlmodelc into my swiftui app? I am stuck here? I want to use coreml support. is there any example that I can follow?

  3. danbev commented on Mar 17, 2025

    @danbev
    Member

    The swiftui example currently does not have support for coreml, but the objective-c example does, and it contains a link to how to convert models. Perhaps these could be helpful to implement in swift.

  4. furqan4545 commented on Mar 19, 2025

    @furqan4545

    The swiftui example currently does not have support for coreml, but the objective-c example does, and it contains a link to how to convert models. Perhaps these could be helpful to implement in swift.

    I am very beginner in obj C... Would it be possible for you guys to make swift ui example? I think a lot of people would appreciate that because as saw in many other repos people were requesting the same thing.

  5. danbev commented on Mar 19, 2025

    @danbev
    Member

    Would it be possible for you guys to make swift ui example?

    Perhaps we can update the existing whisper.swiftui example similar to whisper.objc. I've created #2907 to track this.

  6. ggerganov commented on Mar 19, 2025

    @ggerganov
    MemberAuthor

    Would it be possible for you guys to make swift ui example?

    Perhaps we can update the existing whisper.swiftui example similar to whisper.objc. I've created #2907 to track this.

    If I am not mistaken, it might be as simple as adding WHISPER_COREML=1 somewhere in the build settings and providing a CoreML model to the project.

  7. danbev commented on Mar 20, 2025

    @danbev
    Member

    If I am not mistaken, it might be as simple as adding WHISPER_COREML=1 somewhere in the build settings and providing a CoreML model to the project.

    Nice, I'll give this a try. Thanks

  8. danbev commented on Mar 20, 2025

    @danbev
    Member

    Hmm, this was not as simple because of the introduction of the xcframework. We are no longer compiling in XCode but instead using the compiled library from the xcframework. And Core ML support requires the above mentioned macro to be set when compiling. My initial throught was that we could provide builds for Core ML for macos and ios and include them in the xcframework, but that does not work as the selection is based on platform and architecture, so trying to create the xcframework results in:

    A library with the identifier 'macos-arm64_x86_64' already exists.

    I'll need to investigate this a little more to understand what our options are.

  9. ggerganov commented on Mar 20, 2025

    @ggerganov
    MemberAuthor

    I think we can enable both WHISPER_COREML=ON and WHISPER_COREML_ALLOW_FALLBACK=ON in the CMake builds and provide only this option in the XCFramework. This way, if at runtime it fails to find a CoreML model, it will fallback to not using it.

  10. danbev commented on Mar 20, 2025

    @danbev
    Member

    I think we can enable both WHISPER_COREML=ON and WHISPER_COREML_ALLOW_FALLBACK=ON in the CMake builds and provide only this option in the XCFramework. This way, if at runtime it fails to find a CoreML model, it will fallback to not using it.

    That would be much things much easier. Great, I'll try this out.

  11. danbev commented on Mar 21, 2025

    @danbev
    Member

    @furqan4545 We've added an example of using Core ML to the whisper.swiftui example now.

  12. 11 remaining items

  13. danbev commented on Apr 2, 2025

    @danbev
    Member

    I think this could be considered completed by the following commits:

    • Update CoreML model conversion/creationinstructions : 11688b2 ✔
    • Add CI workflows to exercise CoreML conversion : 04b9508 ✔
  14. moved this from Todo to Done in whisper.cpp : roadmapon Apr 2, 2025
  15. closed this as completedby moving to Done in whisper.cpp : roadmapon Apr 2, 2025
  16. itsthisjustin commented on Jul 1, 2025

    @itsthisjustin

    the original model is still required for the decoder. Perhaps this could be clarified in the docs.

    Yes, this is correct. We should update the docs to highlight this.

    Reviving an old thread here but can't seem to find documentation on this. What will happen when I run on an Intel mac? Will it just fail completely or will it skip the coreML process?

  17. ggerganov commented on Jul 2, 2025

    @ggerganov
    MemberAuthor

    What will happen when I run on an Intel mac? Will it just fail completely or will it skip the coreML process?

    Hm, I'm actually not sure. I suspect that it will fail, but I no longer have hardware to test this.

  18. itsthisjustin commented on Jul 2, 2025

    @itsthisjustin

    What will happen when I run on an Intel mac? Will it just fail completely or will it skip the coreML process?

    Hm, I'm actually not sure. I suspect that it will fail, but I no longer have hardware to test this.

    Ha yeah same. What I did for now (and i have no idea if it'll work) is I rename the coreml model so the app can't find it when it loads on Intel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildBuild related issuesdocumentationImprovements or additions to documentationroadmapPart of a roadmap project

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions