Skip to content

add support to macOS GPU for inference#890

Open
huiofficial wants to merge 1 commit intoOpenTalker:mainfrom
huiofficial:main
Open

add support to macOS GPU for inference#890
huiofficial wants to merge 1 commit intoOpenTalker:mainfrom
huiofficial:main

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

@huiofficial
Copy link
Author

thanks, it'd be better if u can give a review.

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.

3 participants