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

Apple Silicon port #44

Open
henriquenunez opened this issue Mar 20, 2024 · 1 comment
Open

Apple Silicon port #44

henriquenunez opened this issue Mar 20, 2024 · 1 comment

Comments

@henriquenunez
Copy link

Hello,

First of all, amazing project!

I am opening this issue to ask whether you think it is possible to port the code to the M1/2/3 GPUs. The hardware in our lab is not nvidia, and we would like to use the tool as well.

I would be able to do the porting myself, if some on the maintainers can offer me some guidance!

@georgeoshardo
Copy link
Owner

georgeoshardo commented Mar 29, 2024

Hi, thanks for your interest in SyMBac @henriquenunez! Apologies for the late reply!

I think this code can work on Apple Silicon. The only GPU operation which is used in the main code is CuPy's convolution function. Other GPU code is just PyTorch or Tensorflow, which I believe are gaining support already so that in theory should be covered.

So all we need to do is find a convolution function which can be called from Python and runs on Apple Silicon. Have you any experience utilising the Apple Silicon GPUs using any Python libraries? E.g I think one could leverage Tensorflow's convolution operations if you have managed to get that running before (https://developer.apple.com/metal/tensorflow-plugin/). I do not have access to any Apple Silicon to test this.

In https://github.com/georgeoshardo/SyMBac/blob/main/SyMBac/renderer.py is where I define the convolution function, depending on whether or not CuPy is installed. All we would need to do is check for Apple Silicon and implement a version which uses tensorflow-metal.

This blog post looks like a nice starting point https://www.laurencegellert.com/2023/10/how-make-python-code-run-on-the-gpu/

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

No branches or pull requests

2 participants