Skip to content

llama : expose API to retrieve devices associated with the model. #12073

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vlovich
Copy link
Contributor

@vlovich vlovich commented Feb 25, 2025

It's useful from the library to be able to do things like list the features being used by the session. For some reason I'm seeing the model->devices vector be empty so maybe it isn't used anymore?

@vlovich vlovich force-pushed the retrieve-devices branch 2 times, most recently from 2035c0d to f47bc43 Compare March 1, 2025 15:39
@vlovich vlovich force-pushed the retrieve-devices branch from f47bc43 to edf8ca2 Compare June 6, 2025 14:55
@vlovich
Copy link
Contributor Author

vlovich commented Jun 6, 2025

@ggerganov is there a process for getting review on a small PR? This has sat around for a little while in limbo so wondering how I can make progress.

@ggerganov
Copy link
Member

I am a bit unsure about the usefulness of this API interface. What features are you interested in listing about the session?

@vlovich vlovich force-pushed the retrieve-devices branch from edf8ca2 to f279daf Compare June 6, 2025 15:33
It's useful from the library to be able to do things like list the
features being used by the loaded model.
@vlovich vlovich force-pushed the retrieve-devices branch from f279daf to 89aad5a Compare June 6, 2025 15:53
@vlovich
Copy link
Contributor Author

vlovich commented Jun 9, 2025

I'm trying to figure out what backends the session is selected to run on.

@slaren
Copy link
Member

slaren commented Jun 9, 2025

You can enumerate the available devices using the ggml-backend API. If you want to choose which ones to use, you can do so by setting llama_model_params::devices when loading a model.

@vlovich
Copy link
Contributor Author

vlovich commented Jun 10, 2025

That doesn't really help me though because I'm not trying to tell GGML to use a specific device. I'm trying to figure out which device(s) GGML chose. That's also why the available devices isn't helpful because I don't know what GGML actually ends up picking.

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.

3 participants