-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
base: main
Are you sure you want to change the base?
Add dtype checks in meta dispatch for various ordering ops #159556
Conversation
This PR needs a
|
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. |
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