8000 [MPS] Add boilerplate sparse code support by Isalia20 · Pull Request #157238 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@Isalia20
8000 Copy link
Collaborator
@Isalia20 Isalia20 commented Jun 29, 2025

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
#129842
which is highly requested(I assume because of whisper using sparse tensors)

cc @alexsamardzic @nikitaved @pearu @cpuhrsch @amjames @bhosmer @jcaip @kulinseth @albanD @malfet @DenisVieriu97 @jhavukainen

@pytorch-bot
Copy link
pytorch-bot bot commented Jun 29, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/157238

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 Cancelled Jobs, 3 Pending, 1 Unrelated Failure

As of commit b75c8aa with merge base 029e2b0 (image):

CANCELLED JOBS - The following jobs were cancelled. Please retry:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@Isalia20 Isalia20 added module: mps Related to Apple Metal Performance Shaders framework module: sparse Related to torch.sparse ciflow/mps Run MPS tests (subset of trunk) labels Jun 29, 2025
@pytorch-bot
Copy link
pytorch-bot bot commented Jun 29, 2025

To add the ciflow label ciflow/mps please first approve the workflows that are awaiting approval (scroll to the bottom of this page).

This helps ensure we don't trigger CI on this PR until it is actually authorized to do so. Please ping one of the reviewers if you do not have access to approve and run workflows.

@pytorch-bot pytorch-bot bot removed the ciflow/mps Run MPS tests (subset of trunk) label Jun 29, 2025
@github-actions
Copy link
Contributor

Attention! native_functions.yaml was changed

If you are adding a new function or defaulted argument to native_functions.yaml, you cannot use it from pre-existing Python frontend code until our FC window passes (two weeks). Split your PR into two PRs, one which adds the new C++ functionality, and one that makes use of it from Python, and land them two weeks apart. See https://github.com/pytorch/pytorch/wiki/PyTorch's-Python-Frontend-Backward-and-Forward-Compatibility-Policy#forwards-compatibility-fc for more info.


Caused by:

@github-actions
Copy link
Contributor

Attention! PyTorch one of the C-stable API file was changed

You MUST NOT change existing function declarations in this, as this header defines a stable C ABI. If you need to change the signature for a function, introduce a new v2 version of the function and modify code generation to target the new version of the function.


Caused by:

@malfet malfet added topic: improvements topic category ciflow/mps Run MPS tests (subset of trunk) labels Jun 29, 2025
@malfet malfet changed the title [MPS] sparse tensor support for MPS initial changes [MPS] Add boilerplate sparse code support Jun 29, 2025
SparseCUDA,
SparseCsrCPU,
SparseCsrCUDA,
SparseCsrMPS,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need CSR? May be let's just do regular Sparse, that would be sufficient for whisper

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm wrong, let's keep it there...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, whisper probably won't work with this PR only(haven't tested though), but this is a starter. More will follow, didn't want to submit one huge PR with all the necessary ops implemented

@malfet malfet added the ciflow/trunk Trigger trunk jobs on your pull request label Jun 29, 2025
@malfet
Copy link
Contributor
malfet commented Jun 30, 2025

@pytorchbot merge -f "All relevant signal is green"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/mps Run MPS tests (subset of trunk) ciflow/trunk Trigger trunk jobs on your pull request Merged module: mps Related to Apple Metal Performance Shaders framework module: sparse Related to torch.sparse open source release notes: inductor (aoti) topic: improvements topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0