-
Notifications
You must be signed in to change notification settings - Fork 75
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
macOS MPS support for torched-net? #242
Comments
Hi, I believe @sef43 was trying to build torchmd-net for OSX AFAIK, maybe he can share his insights :P |
Ookay, thank you for your quick reply. |
Yes there are two parts to this.
|
You can install torchmd-net on MacOS using the Linux build from source instructions. You will need to set You will need to make it run on CPU, MPS does not work yet:
|
Okay, I will keep an eye on how this evolves. Thank you very much! |
There are other unsupported pytorch operations in the get_neighbor_pairs code, e.g: This is not something we can easily do from our end. Will have to wait on PyTorch to have implementations for the operations we need - pytorch/pytorch#77764 |
Just for completeness, when all required operations are available in that backend the neighbor extension can be made MPS-compatible by adding a new TORCH_LIBRARY_IMPL registration simply copy-pasting the CPU implementation: torchmd-net/torchmdnet/extensions/neighbors/neighbors_cpu.cpp Lines 92 to 98 in 0275e54
TORCH_LIBRARY_IMPL(torchmdnet_extensions, MPS, m) {
m.impl("get_neighbor_pairs", [](const std::string &strategy, const Tensor& positions, const Tensor& batch, const Tensor& box_vectors,
bool use_periodic, const Scalar& cutoff_lower, const Scalar& cutoff_upper,
const Scalar& max_num_pairs, bool loop, bool include_transpose) {
return forward(positions, batch, box_vectors, use_periodic, cutoff_lower, cutoff_upper, max_num_pairs, loop, include_transpose);
});
} |
Hi,
I'm new using all the "torch" things and I wonder if it is possible to somehow use the Metal Performance Shaders (MPS) for Accelerated PyTorch training on Mac with torchmd-net.
Thank you in advance.
David
The text was updated successfully, but these errors were encountered: