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

Fix MPS usage via autocast change #84

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bcherry
Copy link

@bcherry bcherry commented Jun 26, 2023

Hello!

I'm using this on an Apple Silicon device (M1 Max) and noticed that it fails to use MPS. It seems the issue comes from the amp.autocast call, which is hardcoded to CUDA here. While there is no M1 support for AMP yet, changing it to use "cpu" in this spot seems to fix it and get torch running on MPS anyways instead of falling back to CPU on Apple Silicon.

Let me know if there's anything else you'd like, if this is of interest to merge! I'm just tinkering at this point and will eventually move to a linux-based production deployment anyways so this isn't really mission-critical.

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 this pull request may close these issues.

None yet

1 participant