-
Notifications
You must be signed in to change notification settings - Fork 4.9k
if GGML_BACKEND_DL defined use one of the ggml_backend_load functions #3057
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
Closed
Closed
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3d3493e
Expose ggml_backend_load_best
peardox 81965b5
Fix header ggml\include\ggml_backend.h
peardox bee63b8
if GGML_BACKEND_DL defined don't use whisper_load_backends in whisper…
peardox cc265ab
Update examples bench, cli and stream to cater for alternate backend …
peardox b96679c
Fix dumb type eneif -> endif
peardox 3a46af0
Add print_error_no_device and trigger if null backend passed. There m…
peardox 5fb957a
Remove all references to whisper_load_backends
peardox 0146f98
Enable ggml_backend_load_best and allow only one device to be requested
peardox e1ba412
Rename WHISPER_BACKEND_DL -> GGML_BACKEND_DL
peardox 1fffca3
Modify bench.cpp to add -d/--device option for GGML_BACKEND_DL only
peardox 0ebfeb5
Remove ggml-backend.cpp/h alterations
peardox 4f310d1
Temp state
peardox 1d7a9c4
Tidy up and play nice
peardox 18edf34
Tidy up and play nice
peardox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is not currently available to applications, but I agree that it should. I will make the change necessary to make this function public, but at the moment it cannot be used here.
There is also an important distinction between devices and backends. Backends may have multiple devices, e.g. in a system with multiple GPUs, and it would be good to add the ability to whisper.cpp to choose what device to use, but that would need to be done in a different way (e.g. by making whisper.cpp accept a
ggml_backend_dev_t
object inwhisper_context_params
). The implementation in llama.cpp may be useful to use as a guide, although it is a bit more complicated since llama.cpp can use multiple devices at the same time.In conclusion:
--backend
parameter to choose which backend to load would be good, but either needs to useggml_backend_load
to load specifically the file given by the user, or it would need to wait untilggml_backend_load_best
is made public--device
parameter to choose which device to use would also be good, but it must be a separate settingProbably better left for a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So in the meanwhile I can safely expose ggml_backend_load_best before it's public? That's a good start from my point of view (fairly lost without it loading cpu on older machines).
I'll wrap it in a whisper_load_device function making sure that there's at least one cpu at end of list which should be OK?
Two modifications I made to ggml-backend.cpp were dealing with passing a nullptr to functions that wanted to return a member of the passed parameter.