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

torch.cuda.get_device_capability() for R? #729

Closed
rdinnager opened this issue Nov 3, 2021 · 4 comments · Fixed by #734
Closed

torch.cuda.get_device_capability() for R? #729

rdinnager opened this issue Nov 3, 2021 · 4 comments · Fixed by #734

Comments

@rdinnager
Copy link
Collaborator

rdinnager commented Nov 3, 2021

In some Python code I am trying to port it uses torch.cuda.get_device_capability() to decide whether to use some custom ops (e.g. Ampere vs. Volta). Is there a way to get equivalent information from torch in R? I can't seem to find an equivalent function, but I could be missing it.
Many thanks.

@dfalbel
Copy link
Member

dfalbel commented Nov 4, 2021

Currently its not implemented, but we should be able to get this information by wrapping at::cuda::getDeviceProperties:

https://pytorch.org/cppdocs/api/function_namespaceat_1_1cuda_1af6a77be40bebc6666d6832d071f7412c.html#exhale-function-namespaceat-1-1cuda-1af6a77be40bebc6666d6832d071f7412c

@rdinnager
Copy link
Collaborator Author

@dfalbel
Copy link
Member

dfalbel commented Nov 5, 2021

Sure! It would be awesome!

You will also need to export the function in the lantern headers.
See for example this PR:

https://github.com/mlverse/torch/pull/713/files#diff-cdf41c6f2680495f3b1bb228ee65924bcf3bd39fc73df81f922163600f8d9504R724

@rdinnager
Copy link
Collaborator Author

Ah yes of course. Thanks for the example PR, I should be able to work everything out by following it.

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 a pull request may close this issue.

2 participants