Skip to content

Add function to pick_device based on models availability and use request.#90

Merged
Luthaf merged 3 commits intomainfrom
pick-device
Sep 19, 2025
Merged

Add function to pick_device based on models availability and use request.#90
Luthaf merged 3 commits intomainfrom
pick-device

Conversation

@PicoCentauri
Copy link
Copy Markdown
Contributor

@PicoCentauri PicoCentauri commented Sep 17, 2025

Fixes #21

We have something similar in metatrain

Biggest question now is, how we handle multi GPU requests. We have this in LAMMPS and also would need this to replace the metatrain function. We could add another parameter?

Contributor (creator of pull-request) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • Issue referenced (for PRs that solve an issue)?

Reviewer checklist

  • CHANGELOG updated with public API or any other important changes?

📚 Download documentation for this pull-request

@Luthaf
Copy link
Copy Markdown
Member

Luthaf commented Sep 17, 2025

Biggest question now is, how we handle multi GPU requests. We have this in LAMMPS and also would need this to replace the metatrain function. We could add another parameter?

Either we handle it here or inside LAMMPS. Maybe doing it inside LAMMPS makes the most sense since that's where we know about more things (in a sense this function is only picking the device type, not the device id).

device = pick_best_device(...)
if device.is_cuda:
     # change the device ID with the current code

Comment thread metatomic-torch/src/register.cpp Outdated
Comment thread metatomic-torch/include/metatomic/torch/misc.hpp Outdated
Comment thread metatomic-torch/src/misc.cpp Outdated
Comment thread metatomic-torch/include/metatomic/torch/misc.hpp Outdated
Comment thread metatomic-torch/src/misc.cpp Outdated
PicoCentauri and others added 2 commits September 19, 2025 14:49
Co-authored-by: Guillaume Fraux <guillaume.fraux@epfl.ch>
@PicoCentauri PicoCentauri requested a review from Luthaf September 19, 2025 13:44
@Luthaf
Copy link
Copy Markdown
Member

Luthaf commented Sep 19, 2025

Thanks!

@Luthaf Luthaf merged commit 9607837 into main Sep 19, 2025
7 checks passed
@Luthaf Luthaf deleted the pick-device branch September 19, 2025 15:17
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.

Utility function to select the best device for a model

2 participants