Skip to content

Conversation

@finnvoor
Copy link
Contributor

@finnvoor finnvoor commented Jan 2, 2024

We are using whisper.cpp in an iOS app and due to GPU execution not being permitted when an iOS app is in the background, we are seeing crashes at https://github.com/ggerganov/whisper.cpp/blob/f9ca90256bf691642407e589db1a36562c461db7/ggml-metal.m#L2385

This PR returns a bool from graph_compute indicating failure instead of asserting false to avoid crashing. Wasn't sure if this was the best way to fix this issue, but it is working for us at least. All backends other than metal currently just return true.

Please let me know if I missed something or if anyone has better ideas for error handling.

Fixes #1670 and #1664

Copy link
Member

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good to merge (cc @slaren)

Copy link
Member

@slaren slaren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good, we need to make more errors recoverable.

@ggerganov ggerganov merged commit a3d0aa7 into ggml-org:master Jan 3, 2024
viktor-silakov pushed a commit to viktor-silakov/whisper_node_mic.cpp that referenced this pull request May 11, 2024
iThalay pushed a commit to iThalay/whisper.cpp that referenced this pull request Sep 23, 2024
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.

METAL: The library on iOS, Swift code, fails when running a transcription in background

3 participants