-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Complex dispatch should be disabled on min/max functions #50064
Comments
Can I work on it @anjali411? |
@rishabhvarshney14 yes absolutely! please feel free to add me as a reviewer for your PR |
Reopening. The linked PR only disables dispatch on cpu reductions, it does not handle pointwise operations, and it does not handle cuda operations. |
Hello @ngimel, Sorry about that! l had realized that I hadn't disabled the type-checks introduced in #36377, after Richard suggested writing a test, and I recently submitted another PR (#50465). For CPU min/max ops in TensorCompareKernel.cpp, I had skipped it by mistake due to some confusion between the names of As for the CUDA operations, their kernels do not seem to be compiled & dispatched for complex types anyway, so I think that no further changes are required. Please confirm if my rationale is correct. Thanks! Basically, the dispatch macros currently being used don't have cases (of switch statements) for complex types, so they'd default to error for complex types.
|
Duplicate comment from #50465 for the convenience of any potential readers in the future. Please skip if you read the PR #50465. There are a few cases in which the methods corresponding to
The first dtype check requirement can be verified from the following example Python code:
|
As of #36377, min/max functions were disabled for complex inputs (via dtype checks), however, min/max kernels are still compiled and dispatched for complex, see e.g.
pytorch/aten/src/ATen/native/cpu/ReduceAllOpsKernel.cpp
Line 77 in e44b2b7
This dispatch should be disabled, and we should rely on errors produced by dispatch macro to not run those ops on complex, instead of doing redundant dtype checks.
cc @ezyang @anjali411 @dylanbespalko @mruberry
cc @t-vi, thanks for reporting!
The text was updated successfully, but these errors were encountered: