-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Closed
Labels
module: correctness (silent)issue that returns an incorrect result silentlyissue that returns an incorrect result silentlymodule: mpsRelated to Apple Metal Performance Shaders frameworkRelated to Apple Metal Performance Shaders frameworkmodule: regressionIt used to work, and now it doesn'tIt used to work, and now it doesn'ttriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Milestone
Description
🐛 Describe the bug
Repro:
import torch
tcpu = torch.tensor([1.0,2.0,3.0], device="cpu")
torch.copysign(tcpu, -2.0) # tensor([-1., -2., -3.])
t = torch.tensor([1.0,2.0,3.0], device="mps")
torch.copysign(t, -2.0) # tensor([1., 2., 3.], device='mps:0')
Internally, the scalar is wrapped into a cpu tensor and then re-dispatched.
Three possible solutions here:
- Wrap the scalar into an mps tensor instead of a cpu tensor.
- Send the cpu tensor to mps in the binary kernel.
- Error out rather than produce incorrect results.
Versions
nightly
Metadata
Metadata
Assignees
Labels
module: correctness (silent)issue that returns an incorrect result silentlyissue that returns an incorrect result silentlymodule: mpsRelated to Apple Metal Performance Shaders frameworkRelated to Apple Metal Performance Shaders frameworkmodule: regressionIt used to work, and now it doesn'tIt used to work, and now it doesn'ttriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module