-
Notifications
You must be signed in to change notification settings - Fork 24.7k
[MPS] Enable angle and atan2 for torch.long
#149017
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/149017
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 30 PendingAs of commit f20efa3 with merge base 6057641 ( 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. |
c2c5deb
to
d248dd8
Compare
torch.long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, left some minor comments inline.
@@ -397,7 +397,7 @@ static void add_sub_lerp_template(const Tensor& self, | |||
}); | |||
} | |||
TORCH_IMPL_FUNC(atan2_out_mps)(const Tensor& self, const Tensor& other, const Tensor& output) { | |||
TORCH_CHECK(self.scalar_type() != ScalarType::Long, "MPS does not support atan2 op with int64 input"); | |||
// TORCH_CHECK(self.scalar_type() != ScalarType::Long, "MPS does not support atan2 op with int64 input"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of commenting this out, can you just remove the line?
@@ -272,7 +272,7 @@ static void unary_op(const Tensor& self, | |||
} | |||
|
|||
Tensor& angle_out_mps(const Tensor& self, Tensor& output) { | |||
TORCH_CHECK(self.scalar_type() != ScalarType::Long, "MPS does not support angle op with int64 input"); | |||
// TORCH_CHECK(self.scalar_type() != ScalarType::Long, "MPS does not support angle op with int64 input"); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept them around, thinking that may be something will fail on MacOS-13, but it did not, so now I can just remove this check
test/test_mps.py
Outdated
@@ -710,8 +710,8 @@ def mps_ops_modifier(ops): | |||
'index_add': [torch.int64], | |||
'log1p': [torch.int64], | |||
'sigmoid': [torch.int64], | |||
'atan2': [torch.int64], | |||
'angle': [torch.int64], | |||
# 'atan2': [torch.int64], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
May be those ops were unsupported on MacOS-12, but they work fine in MacOS-15
d248dd8
to
f20efa3
Compare
@pytorchbot merge -f "Lint + MPS are green" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
This check was added by #85817, that introduced no unit-tests and its content seems to be totally unrelated to title/subject of that PR. Anyway, right now it seems to be working fine on MacOS-13+