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

feat: ✨ Add support for training on Apple M1/M2/M3 (mps) devices. #311

Merged
merged 4 commits into from
Oct 24, 2024

Conversation

rhoadesScholar
Copy link
Member

Also add log printing of device used for training.

Also add log printing of device used for training.
Copy link
Member Author

@rhoadesScholar rhoadesScholar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good 👍🏼

@rhoadesScholar
Copy link
Member Author

Fixed weights being float64 in GunpowderTrainer line 317. Does train.

One more place where you have to(device) and then float().
numpy default float is 64, so the to(device) will fail if the device is
MPS that doesn't support float64.
Copy link
Member Author

@rhoadesScholar rhoadesScholar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gtg

@mzouink mzouink merged commit 193b71b into main Oct 24, 2024
4 checks passed
@mzouink mzouink deleted the mps_device branch October 24, 2024 10:05
@psobolewskiPhD
Copy link
Contributor

psobolewskiPhD commented Oct 24, 2024

Ran locally on the minimal_tutorial (I2K).
85+% GPU utilization, still >400% CPU.
Ironically, it's a bit slower: 5.5 it/s vs ~8 it/s on my 2020 M1 so may consider allowing user to pass a device somewhere.
Interestingly, the issue with poor labels after training (stripping) I had during the workshop was resolved.
🤷

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