-
Notifications
You must be signed in to change notification settings - Fork 24.1k
General MPS op coverage tracking issue #77764
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
Are there any linear algebra ops not implemented in MPS that you have made custom shaders for? Any shaders I could "borrow" from your project (with full credit) and use in my own? Specifically, it would be helpful to have SVD and reverse-mode Cholesky operators. |
Hey, There are no custom shaders at the moment as everything we needed for the basic networks we looked at was already provided by MPS (or a set of ops in MPS). Also , required functions that are not in the hot path are simply falling back to CPU for now. It is mentioned here as this is something that is possible to be done easily within the integration. But not something that is used today. |
I was testing a bunch of speech synthesis and vocoder models, and found the following operators missing so far:
|
One vote for a CPU fallback for Is there any reason, given the unified memory architecture, that every op not implemented on Metal cannot just fall back to the CPU implementation without memory copy operations? (Based, of course, on my 10,000ft view of the architecture, which I'm sure is wildly oversimplified.) |
Tip for everyone: Run your script with PYTORCH_ENABLE_MPS_FALLBACK=1 which will fallback to the CPU. I'm using a custom build which merges pull request #77791 so am not sure if this is included in the current build (Edit: It's not. You need to build PyTorch yourself with the pull request or trust an online build with it). |
Testing with some huggingface transformers code: + 1 vote for |
One missing op I ran into and haven't seen mentioned yet is
then
and finally the forward pass through my model crashes with
On |
+1
|
@lhoenig could you open a new separate issue for the cpu fallback failing for you? @Willian-Zhang the fallback is ONLY available if you build from source right now. It will be in the nightly build tomorrow (May 21st). |
Would like to add |
I've got a non supported op:
|
Not supported
Code X, y = torch.rand(16, 10).to("mps"), torch.rand(16, 1).to("mps")
model = nn.Linear(10, 1).to("mps")
criterion = nn.L1Loss() # nn.KLDivLoss()
loss = criterion(model(X), y)
loss.backward() Output
|
Trying to use affine crop from torchvision, and found the operator |
Trying to use MPS backend with pytorch geometric, and found the operator |
Found the operator 'aten::grid_sampler_2d' is not current implemented for the MPS device. |
Would be great to add |
I ran into this error with |
Voting for 'aten::linalg_lu_factor_ex.out' |
I'd also like to propose transpose_conv3d |
AddedTip If your error text is below this line, you don't need to vote. These have been added.MacOS PyTorch is at
|
NotImplementedError: The operator 'aten::unfold_backward' is not currently implemented for the MPS device. |
The operator 'aten::scatter_reduce.two_out' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on #77764. As a temporary fix, you can set the environment variable |
it is, update your pytorch
it is, update your pytorch AddedTip If your error text is below this line, you don't need to vote. These have been added.MacOS PyTorch is at
|
How much work is it to actually implement something like Can one do it by generalizing from the existing implementation of I suspect there is a snag, otherwise it would have been implemented. |
Hello, Had an issue with 'aten::upsample_bicubic2d.out' and then did the PyTorch update via link above, but error stil exists. If I'm making PYTORCH_ENABLE_MPS_FALLBACK=1 it runs, but I'm getting an error RuntimeError: Invalid buffer size: 3.54 GB with quality I need to get. How it can be fixed? |
your torch is v 2.2. Not 2.7 Firstly, Install a newer python don't use or upgrade the Python provided with the Mac. Secondly, Use a venv. That way you can keep torch and other components separate from the installation, and if you make a mistake you don't mess up the Python installation. |
Third most voted op from #77764 Tests were deleted because they are covered by the regular test_output_match tests so those were redundant and were added in the last PR before the nanmedian dim version would be implemented Pull Request resolved: #149680 Approved by: https://github.com/malfet Co-authored-by: Nikita Shulga <[email protected]>
Hi all, My code runs on the MBP with M4 chips,
does this issue be fixed now? thanks |
Please try again with torch 2.8
if not, you can try |
Third most voted op from pytorch#77764 Tests were deleted because they are covered by the regular test_output_match tests so those were redundant and were added in the last PR before the nanmedian dim version would be implemented Pull Request resolved: pytorch#149680 Approved by: https://github.com/malfet Co-authored-by: Nikita Shulga <[email protected]>
@MarcusEddie can you create an issue about it. And may be with minimal reproducer? I.e. trying to understand why you need a distributed op on a single GPU system |
NotImplementedError: The operator 'torchvision::nms' is not currently implemented for the MPS device. If you want this op to be added in priority during the prototype phase of this feature, please comment on #77764. As a temporary fix, you can set the environment variable |
The operator 'aten::linalg_svd' is not currently supported on the MPS backend and will fall back to run on the CPU. This may have performance implications. |
NotImplementedError: The operator 'aten::_linalg_solve_ex.result' is not currently implemented for the MPS device. |
Cf. #77764 (comment) Just wanted to let you know that this is fixed in pytorch v2.7 (tested on Mac OS 15.4.1 with M4 Pro and python 3.12.10). Thank you. |
+1 for |
|
Hi ! Do you have some news about Apple Silicon support ? |
Hi @malfet |
This issue is to have a centralized place to list and track work on adding support to new ops for the MPS backend.
PyTorch MPS Ops Project : Project to track all the ops for MPS backend. There are a very large number of operators in pytorch and so they are not all yet implemented. We will be prioritizing adding new operators based on user feedback. If possible, please also provide link to the network or use-case where this op is getting used.
As Ops are requested we will add " To Triage" pool. If we have 3+ requests for an operation and given its complexity/need the operation will be moved "To be implemented" pool. If you want to work on adding support for such op, feel free to comment below to get assigned one. Please avoid pickup up an op that is already being worked on tracked in "In progress" pool.
Link to the wiki for details on how to add these ops and example PRs.
MPS operators coverage matrix - The matrix covers most of the supported operators but is not exhaustive. Please look at the
In vx.x.x
column, if the box is green, it means that the op implementation is included in the latest release; on the other hand, if the box is yellow, it means the op implementation is in the nightly and has not yet included in the latest release. Before you comment below, please take a look at this matrix to make sure the operator you're requesting has not been implemented in nightly. More details can be found on the readme.cc @kulinseth @malfet @DenisVieriu97 @jhavukainen
The text was updated successfully, but these errors were encountered: