-
Notifications
You must be signed in to change notification settings - Fork 174
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
MPS Support #96
Comments
@ProGamerGov Yeah it should be relatively straight forward, however I currently don't have a way to test it. |
@trbutler Try running this WIP neural-style-pt branch on MPS: https://github.com/ProGamerGov/neural-style-pt/tree/master-2 |
@ProGamerGov Thanks! I just tried it and it doesn't seem to be paying attention to my request to switch backends. For example upon typing:
It starts and then gives the same error:
Perhaps the backend isn't getting passed along? |
@ProGamerGov I just realized if I set both Currently running |
Results using mps vs. cpu:
I couldn't get |
I think this this because the default for However, this leads to another error
But this can be easily resolved by modifying these lines... neural-style-pt/CaffeLoader.py Lines 113 to 120 in 639fa26
...to the following: def name_devices(self, input_list):
device_list = []
for i, device in enumerate(input_list):
if str(device).lower() not in ("cpu", "mps"):
device_list.append("cuda:" + str(device))
else:
device_list.append(device)
return device_list |
Running neural-style-pt on Apple Silicon seems to require using only CPU or it terminates with this error:
Given that PyTorch now supports native Apple Metal acceleration, is there a way to fix this so it'd use MPS?
The text was updated successfully, but these errors were encountered: