-
Notifications
You must be signed in to change notification settings - Fork 24.1k
torch.nn.Conv3D on MPS backend #77818
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
Comments
bump |
Hi, Thanks for the report. |
Thanks for the issue, @tfmoraes , we indeed don't have Conv3D support, but should do a better job of reporting error. |
@kulinseth is there an intention to support Conv3D and other 3D layers? At InVesalius we use Conv3D in our 3D implementation of Unet. |
Hi there, it looks like MPS is only allowing rank 4 tensors, is this something we can (want to?) work around, or do we need MPS to natively support 3D (or nd) convolutions? |
any updates on this? |
@tfmoraes , thatβs right we are planning to support Conv3D in MPS layer . Unfortunately I canβt discuss the time line but will update the Issue with PR enabling the support . |
Hey @kulinseth can I be assigned to the issue? |
We are still waiting on the MPS support to be available in OS and then I can assign the issue . Thanks for your interest @mirceatlx |
I am using |
This would quite helpful - I'm working through Deep Learning With PyTorch which has a good in-depth case study relying on |
After torch 2.0 release the problem is still here. When can users expect conv3s will be compatible with mps on M1 Mac machines? |
I just added a pull request that implements 3D convolutions and its backward in MPS. Seems pretty straightforward with certain limitations (no transpose 3D convolution available in MPSGraph). I have also started working on Pooling operations (Max/Avg) in 3D, which are slightly more tricky since MPS only provides 4D operators, so some reshaping is required. |
@mattiaspaul I've been using your implementation of the mps 3d convolutions for the last week. Thanks for that! I also have a fully working implementation of mps MaxPool3D locally that uses MPS's maxPooling4DWithSourceTensor function as a workaround. I will open an issue so it can get tagged in a future PR. Are you far along with your implementation of MaxPool3D? Otherwise, I can create a PR. |
Here's the issue I created for supporting maxpool3d on mps: #100674 |
Hello, when will the 3D convolutions and maxpool3d be incorporated? I saw that both are under review. When can we expect them? Both would be really useful. |
Fixes pytorch#77818 I saw that PR pytorch#99246 was approved, but no one fixed the rebase conflicts, so I am bringing this up again to be merged. I am leveraging @mattiaspaul work. Quoting the description here: > * this pull request enables 3D convolutions (forward/backward) for MPS (Apple Silicon) within the same Convolution.mm file as conv2d. > * does not support channel_last (since pytorch doesn't implement channel_last for 3D tensors) > * does not support conv3d_transpose and treats depth-separable convolutions not as normal case (there are no MPS kernels available for either of those so far) > * requires MacOS >=13.2 (Ventura) Please, let me know if there are any other changes needed and I'll be happy to implement them. Pull Request resolved: pytorch#114183 Approved by: https://github.com/malfet
Fixes pytorch#77818 I saw that PR pytorch#99246 was approved, but no one fixed the rebase conflicts, so I am bringing this up again to be merged. I am leveraging @mattiaspaul work. Quoting the description here: > * this pull request enables 3D convolutions (forward/backward) for MPS (Apple Silicon) within the same Convolution.mm file as conv2d. > * does not support channel_last (since pytorch doesn't implement channel_last for 3D tensors) > * does not support conv3d_transpose and treats depth-separable convolutions not as normal case (there are no MPS kernels available for either of those so far) > * requires MacOS >=13.2 (Ventura) Please, let me know if there are any other changes needed and I'll be happy to implement them. Pull Request resolved: pytorch#114183 Approved by: https://github.com/malfet
π Describe the bug
Using
Conv3D
on MPS backend, like in this sample code:Python process are being aborted with this error:
This is the full report:
Versions
cc @kulinseth @albanD @malfet @DenisVieriu97 @razarmehr @abhudev
The text was updated successfully, but these errors were encountered: