Skip to content

Conversation

@sezelt
Copy link
Contributor

@sezelt sezelt commented Dec 17, 2024

This adds an MPS backend implementation for aten::angle and aten::angle_out (mentioned in issue #77764), following the example #78408.

@pytorch-bot pytorch-bot bot added the release notes: mps Release notes category label Dec 17, 2024
@pytorch-bot
Copy link

pytorch-bot bot commented Dec 17, 2024

🔗 Helpful Links

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

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

⏳ No Failures, 22 Pending

As of commit 0829200 with merge base 91bf2e1 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@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:

@mikaylagawarecki mikaylagawarecki added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Dec 18, 2024
@malfet malfet added the ciflow/mps Run MPS tests (subset of trunk) label Dec 26, 2024
@malfet
Copy link
Contributor

malfet commented Dec 26, 2024

Looks good to me in theory, but it needs a special case for handling non-complex types, as documented in https://pytorch.org/docs/stable/generated/torch.angle.html

@sezelt
Copy link
Contributor Author

sezelt commented Jan 4, 2025

For real inputs, imaginaryPartOfTensor returns zeroes so the behavior is correct there, I added float32 input to the tests to test to make sure. I've updated it so that it returns float32 for integer inputs to match CPU behavior. I also moved the function into UnaryOps.mm and used the template in there rather than have a separate file. I updated the pass/fail expectations in TestConsistency and the consistency checks are now passing. On macOS 13 it's limited to only real inputs but does behave correctly for them.

@malfet
Copy link
Contributor

malfet commented Jan 4, 2025

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

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 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