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

attempt to autodetect device #14

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

Conversation

karpathy
Copy link
Contributor

but actually this is slower on my macbook running on mps, i think because the model is so small. maybe the autodetect logic should be improved. not 100% sure if i want to merge this in this module hmm...

…ok running on mps, i think because the model is so small. maybe the autodetect logic should be improved. not 100% sure if i want to merge this in this module hmm...
@timmermansjoy
Copy link

This is indeed a known issue in pytorch specially on smaller kernels with MPS. specially since not all operations are made for MPS and can still revert to being run on the CPU

That is why apple also has developed MLX which caters specifically to the unique apple M architecture with having unified memory the CPU and GPU can both work on the kernels, here is the docs if you would like to read more about the project

@navid-matinmo
Copy link

Yes I have observed in my pytorch projects that cpu is faster than mps (for any scale that fits in my ram, and this is for M2 chip)

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