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

add support to macOS GPU for inference #890

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

huiofficial
Copy link

Use torch.backends.mps.is_available() to check whether GPU is available for PyTorch on macOS.

Use to.(xx.device) to match op device for computing.

Use os.environ['PYTORCH_ENABLE_MPS_FALLBACK'] = '1' to deal with operator 'aten::grid_sampler_3d' is not currently implemented for the MPS device.

And I optimized imports in inference.py

@yukiarimo
Copy link

How fast is it?

@bruno-cunha
Copy link

How fast is it?

I tested it in my M1 and got 2x faster

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

3 participants