Skip to content

whisper : remove whisper_load_backends function #3196

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

Merged
merged 2 commits into from
May 29, 2025

Conversation

danbev
Copy link
Collaborator

@danbev danbev commented May 28, 2025

This commit removes the whisper_load_backends function, which was used
to load all GGML backends.

The motivation for this change push the responsibility of loading
backends to user applications to give them more control over which
backends to load and when. See the references below for more context.

Resolves: #3182
Refs: #3042 (comment)
Refs: #3042 (comment)

@peardox
Copy link
Contributor

peardox commented May 28, 2025

I did this ages ago but the PR got refused

@ggerganov
Copy link
Member

@danbev The correct fix should be: #3042 (comment)

This commit removes the `whisper_load_backends` function, which was used
to load all GGML backends.

The motivation for this change push the responsibility of loading
backends to user applications to give them more control over which
backends to load and when. See the references below for more context.

Resolves: ggml-org#3182
Refs: ggml-org#3042 (comment)
Refs: ggml-org#3042 (comment)
@danbev danbev force-pushed the backend-dl-load-model branch from 4cf2aa3 to 1eb69c0 Compare May 28, 2025 12:02
@danbev danbev changed the title whisper : load backends before loading the model whisper : remove whisper_load_backends function May 28, 2025
@danbev
Copy link
Collaborator Author

danbev commented May 28, 2025

I did this ages ago but the PR got refused

Sorry, I've not been following this but trying to catch up now.

@KitaitiMakoto
Copy link
Collaborator

You may keep Ruby tests failed if you want to. I will investigate and fix after merged.

This commit adds a check to ensure that the `rwc` pointer is not NULL
before attempting to mark its members in the garbage collector.

The motivation for this is an attempt to see if this fixed the CI build
as I'm not able to reproduce the issue locally.

Refs: https://github.com/ggml-org/whisper.cpp/actions/runs/15299612277/job/43036694928?pr=3196
@danbev
Copy link
Collaborator Author

danbev commented May 28, 2025

You may keep Ruby tests failed if you want to. I will investigate and fix after merged.

Thanks, I was not able to reproduce the error locally but made an attempt to "fix" it. But otherwise I will gratefully take you up on your offer :)

@peardox
Copy link
Contributor

peardox commented May 28, 2025

There's another problem here...

whisper_load_backend calls ggml_backend_load_all
ggml_backend_load_all calls ggml_backend_load_best alphabetically
This means cuda always comes before vulkan
whisper_backend_init_gpu iterates over backends so therefore always uses cuda in preference to vulkan if both available

This means that cuda would be chosen as the GPU baciend.

In my tests #3139 on the same machine Vulkan is faster on Windows and CUDA is faster under Linux - Difference is currently circa 20%

May be down to NVIDIA's current driver problems (gap was even worse a few weeks ago)

@danbev
Copy link
Collaborator Author

danbev commented May 28, 2025

There's another problem here...

This PR is only trying to address the segment fault in the referenced issue. I'm not saying that the other issues are not important just that those should be handled in separate PRs.

@danbev danbev merged commit 73a8c5f into ggml-org:master May 29, 2025
149 of 153 checks passed
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.

Segfaults when built with DL backend
5 participants