Skip to content
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

User input "gpu" is inplaced renamed to "cuda" #326

Open
PicoCentauri opened this issue Jul 29, 2024 · 0 comments
Open

User input "gpu" is inplaced renamed to "cuda" #326

PicoCentauri opened this issue Jul 29, 2024 · 0 comments
Labels
Good first issue Good for newcomers Infrastructure: Miscellaneous General infrastructure issues Priority: Medium Important issues to address after high priority.

Comments

@PicoCentauri
Copy link
Contributor

If one picks a device as gpu, multi-gpu we change this input inplace to "cuda", "mps" or"multi-cuda" as in

https://github.com/lab-cosmo/metatrain/blob/96f2c74f0a371845497604d7d594d1db6b273a1d/src/metatrain/utils/devices.py#L54-L58

and

https://github.com/lab-cosmo/metatrain/blob/96f2c74f0a371845497604d7d594d1db6b273a1d/src/metatrain/utils/devices.py#L68-L69

I think this is not ideal because probable later error raises will confront the user with a device "cuda" or "multi-cuda" which he did not specify in the input. Maybe it is better to store an internal name like resolved_device and not override the user input.

The linked code above will should be changed to

resolved_device = desired_device

if desired_device == "gpu":
    if torch.cuda.is_available():
        resolved_device = "cuda"
    elif _mps_is_available():
        resolved_device = "mps"

and

 if desired_device == "multi-gpu": 
     resolved_device = "multi-cuda" 
@PicoCentauri PicoCentauri added Good first issue Good for newcomers Priority: Medium Important issues to address after high priority. Infrastructure: Miscellaneous General infrastructure issues labels Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Good for newcomers Infrastructure: Miscellaneous General infrastructure issues Priority: Medium Important issues to address after high priority.
Projects
None yet
Development

No branches or pull requests

1 participant