Skip to content

[MPS] fix empty dot op crash#165237

Closed
Isalia20 wants to merge 1 commit intopytorch:mainfrom
Isalia20:mps-empty-dot
Closed

[MPS] fix empty dot op crash#165237
Isalia20 wants to merge 1 commit intopytorch:mainfrom
Isalia20:mps-empty-dot

Conversation

@Isalia20
Copy link
Collaborator

@Isalia20 Isalia20 commented Oct 11, 2025

reproducer

import torch

# does not crash
a = torch.rand((0), device="cpu")
b = torch.rand((0), device="cpu")
a.dot(b)

# crashes due to internal assert
a = torch.rand((0), device="mps")
b = torch.rand((0), device="mps")
a.dot(b)

Discovered when implementing an op for SparseMPS backend

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 11, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 1fce9ef with merge base 816fb7f (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added the release notes: mps Release notes category label Oct 11, 2025
@soulitzer soulitzer added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Oct 13, 2025
@Isalia20 Isalia20 added the ciflow/mps Run MPS tests (subset of trunk) label Oct 14, 2025
@malfet malfet added the topic: bug fixes topic category label Oct 15, 2025
@malfet
Copy link
Contributor

malfet commented Oct 15, 2025

@pytorchbot merge -f "Lint + MPS are 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

Chao1Han pushed a commit to Chao1Han/pytorch that referenced this pull request Oct 21, 2025
reproducer
```
import torch

# does not crash
a = torch.rand((0), device="cpu")
b = torch.rand((0), device="cpu")
a.dot(b)

# crashes due to internal assert
a = torch.rand((0), device="mps")
b = torch.rand((0), device="mps")
a.dot(b)

```

Discovered when implementing an op for SparseMPS backend
Pull Request resolved: pytorch#165237
Approved by: https://github.com/malfet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/mps Run MPS tests (subset of trunk) Merged open source release notes: mps Release notes category topic: bug fixes topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants