Skip to content

Step towards adding MPS support. #270

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

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

Conversation

anuragg1209
Copy link
Contributor

Hi @LeoGrin & @noahho,

This PR is a step towards adding support for Apple Silicon (mps) #269 . I believe the mps support will not work directly. The two main issues with mps are that:

  1. Torch does not support autocast for mps yet.
  2. The MPS framework doesn't support float64 tensors. We have to use float32 for it to function properly. Due to this, we need to make changes in other areas. I would like to hear your thoughts on this. Please correct me if I am mistaken.

@LeoGrin
Copy link
Collaborator

LeoGrin commented Apr 8, 2025

Thanks @anuragg1209!

The MPS framework doesn't support float64 tensors. We have to use float32 for it to function properly. Due to this, we need to make changes in other areas. I would like to hear your thoughts on this. Please correct me if I am mistaken.

Aren't we defaulting to float32 for the pytorch part (using 64 for the sklearn part only?)? Not sure about that, but I think we can (should?) do that if we need to.

I see that the CI tests on macbook are failing with a memory error. It makes sense that we're using more memory if we're not using autocast, but it seems worrying as the test examples are very lightweight. Do you have an idea of what is the issue? Perhaps one of:

  1. There is an issue with the memory estimation?
  2. Our model/code takes too much memory for a standard mps setting
  3. The CI hardware is unrealistically weak

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.

2 participants