-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Add dtype checks in meta dispatch for various ordering ops #159556
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
Add dtype checks in meta dispatch for various ordering ops #159556
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/159556
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8e848b7 with merge base ecde76c ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Test case? |
|
Thanks for the PR -- I noticed that |
|
Here are some minimal tests to get one started: |
|
I've added the other functions. Sort had a Not sure what that build error is about? |
|
CI failures are related |
|
It seems some of the operations are implemented for bool but not complex -- we should not error on bool for those. |
|
I've updated the operators and added a test so this should cover the correct ops now 🤞 |
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.
thank u!
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / macos-py3-arm64 / test (default, 1, 3, macos-m1-stable) Details for Dev Infra teamRaised by workflow job |
|
One test was failing due to the change I made to make the sort errors more consistent. I've updated this and it passes. |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…159556) This adds data type checks for the unsupported bool and complex types for argmax/min topk, sort, minimum, maximum. As listed here: https://github.com/pytorch/pytorch/blob/0a99b026d6bd0f67dc2c0a20fe3228ddc4144854/torch/testing/_internal/common_methods_invocations.py#L21076 Currently the ops will fail on CPU or CUDA calculation, rather than at meta dispatch stage as with for example max: https://github.com/pytorch/pytorch/blob/0a99b026d6bd0f67dc2c0a20fe3228ddc4144854/aten/src/ATen/native/TensorCompare.cpp#L285 . This will catch it early. Pull Request resolved: pytorch#159556 Approved by: https://github.com/janeyx99
…159556) This adds data type checks for the unsupported bool and complex types for argmax/min topk, sort, minimum, maximum. As listed here: https://github.com/pytorch/pytorch/blob/0a99b026d6bd0f67dc2c0a20fe3228ddc4144854/torch/testing/_internal/common_methods_invocations.py#L21076 Currently the ops will fail on CPU or CUDA calculation, rather than at meta dispatch stage as with for example max: https://github.com/pytorch/pytorch/blob/0a99b026d6bd0f67dc2c0a20fe3228ddc4144854/aten/src/ATen/native/TensorCompare.cpp#L285 . This will catch it early. Pull Request resolved: pytorch#159556 Approved by: https://github.com/janeyx99
This adds data type checks for the unsupported bool and complex types for argmax/min topk, sort, minimum, maximum. As listed here:
https://github.com/pytorch/pytorch/blob/0a99b026d6bd0f67dc2c0a20fe3228ddc4144854/torch/testing/_internal/common_methods_invocations.py#L21076
Currently the ops will fail on CPU or CUDA calculation, rather than at meta dispatch stage as with for example max:
pytorch/aten/src/ATen/native/TensorCompare.cpp
Line 285 in 0a99b02