-
Notifications
You must be signed in to change notification settings - Fork 967
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
[Performance] PyTorch (MPS) is faster than MLX in backward of convolution layer #1313
Labels
Comments
Same benchmark on an M2 Ultra
|
On M2Pro
|
On M3 Max
|
Thanks for the benchmarks everyone! There is clearly an unexpected performance cliff on M1 machines here as MLX is substantially faster on M2+. We'll need to take a deeper look at that to figure out where it's coming from. |
On M1
|
M3 Max: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Recently I profiled the neural network layer performance from MLX and compared with PyTorch. I found that although MLX forwarding is consistently faster than PyTorch, in some chips (M1 Pro, M1 Max), PyTorch is much faster (3x~6x) for convolution forward + backward. While in some chips such as M3 Max, MLX is faster than PyTorch.
To Reproduce
To reproduce this, I have two minimal examples. The networks just have several convolution layers. You may try these two scripts to verify the performance.
time_pytorch_mlx.zip
The text was updated successfully, but these errors were encountered: