[MPS] Add boilerplate sparse code support (#157238)

This PR makes minimal changes to support sparse tensors on MPS. In the followup PRs I'll start adding different operations slowly so we can fix the issue of
https://github.com/pytorch/pytorch/issues/129842
which is highly requested(I assume because of whisper using sparse tensors)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/157238
Approved by: https://github.com/malfet
This commit is contained in:
Isalia20
2025-06-30 01:53:45 +00:00
committed by PyTorch MergeBot
parent 771be85704
commit a1282b1823
9 changed files with 97 additions and 18 deletions

View File

@ -288,6 +288,8 @@ dispatch_keys = [
DispatchKey.SparseCsrXPU,
DispatchKey.SparseCUDA,
DispatchKey.SparseCsrCUDA,
DispatchKey.SparseMPS,
DispatchKey.SparseCsrMPS,
DispatchKey.QuantizedCPU,
DispatchKey.QuantizedCUDA,
DispatchKey.CompositeImplicitAutograd,