-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
whisper.swiftui example not working #1720
Comments
We need to apply similar fix as we did in: ggerganov/llama.cpp#4754 |
Pinging @singularity-s0 as they fixed the build in Here it might be more difficult because the examples uses the |
Xcode build rules don't seem to apply to Swift packages. In fact, this post suggests custom build behavior for Swift packages might not be supported by Xcode at all. Need to find another way around this. |
Ok, pinging @1-ashraful-islam as well |
Just wanted to flag that even when manually changing ggml to look for the default.metallib that does exist, and having the Metal device successfully initialised, the same error log still occurs. |
Did you change the |
So seems like moving |
Yes, I changed it in GGML and in the logs I can see it successfully loads and allocates the Metal buffers but transcription still fails. |
@jeybee I figure it out - there was a divergence in the After syncing it back to the Still, the problem with |
It might be a problem of SPM that bundle resources can't be copied from dependencies, so eg copying |
@ggerganov will the metal files always be present in the respective whisper/llama repos and sync'd with the ggml repo? Perhaps copying the metal files in each whisper/llama swift package while depending on the ggml swift package's compiled ggml lib (but not metal files) solves the twin problems of needing the metal files + avoiding the duplication of symbols compiler error when using both libs? |
Yes, the metal files will always be present in the downstream Swift packages. Probably this is the way to go then |
That did fix the issue, thanks! For now, I'm just updating ggml to look for default.metallib. Is there some reason you couldn't also just change it to do that? |
Ok reverting the change to Alternatively, we can probably create a Swift Package Plugin for |
I can also confirm the observation reported by @zshannon and @jeybee regarding During the build process, for ggml package, Is it possible to revert it back? |
Does that mean the extra build step added to |
We can obviously revert to searching for |
It's my understanding from the research I did today that Xcode bundles all the metal code into a single |
I concur with @zshannon, and came to a similar understanding after reading through the documentation and forums for a few hours. Based on what I understand - this is the default behavior of Swift package manager. To have custom metallib filenames we need to either add extra build steps or add build tool plugins. Prior to Swift tools version 5.3, it seems like developers would need to manually compile the metal files into metallib. Also, parsing through the application bundle- I see the See also: |
Additionally, I have both whisper.cpp and llama.cpp load
|
Ok, thanks for investigating - I will make the changes to revert back to |
Should be OK now using latest |
Thanks for the quick resolution @ggerganov. I believe the issue is resolved and can be closed. |
When running the whisper.swiftui example, compiled in XCode, transcription fails with the following log:
This is using the ggml-base.en.bin model. The whisper.objc sample run on the same machine with the same model works fine.
Tested on a MBP M1 16GB.
The text was updated successfully, but these errors were encountered: