Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cpp_wrapper: Use runtime dispatched fallbacks for complex ops #143223

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

Closed

Conversation

benjaminglass1
Copy link
Collaborator

@benjaminglass1 benjaminglass1 commented Dec 13, 2024

Stack from ghstack (oldest at bottom):

When calling a fallback op in cpp_wrapper mode, where any of the inputs are complex numbers, utilize the runtime dispatched fallback mode. This properly handles the Conjugate and Negative dispatch keys, if present, in exchange for a performance pessimization in complex arithmetic.

This PR additionally fixes some cascading failure modes exposed in our aot_inductor tests by this change.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Dec 13, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 218a34c with merge base bb5e439 (image):
💚 Looks good so far! There are no failures yet. 💚

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

[ghstack-poisoned]
benjaminglass1 added a commit that referenced this pull request Dec 13, 2024
When calling a fallback op in cpp_wrapper mode, where any of the inputs are complex numbers, utilize the runtime dispatched fallback mode. This properly handles the Conjugate and Negative dispatch keys, if present, in exchange for a performance pessimization in complex arithmetic.

ghstack-source-id: 60ab533
Pull Request resolved: #143223
@benjaminglass1 benjaminglass1 self-assigned this Dec 13, 2024
[ghstack-poisoned]
benjaminglass1 added a commit that referenced this pull request Dec 14, 2024
When calling a fallback op in cpp_wrapper mode, where any of the inputs are complex numbers, utilize the runtime dispatched fallback mode. This properly handles the Conjugate and Negative dispatch keys, if present, in exchange for a performance pessimization in complex arithmetic.

ghstack-source-id: 4d2e7ef
Pull Request resolved: #143223
[ghstack-poisoned]
benjaminglass1 added a commit that referenced this pull request Dec 14, 2024
When calling a fallback op in cpp_wrapper mode, where any of the inputs are complex numbers, utilize the runtime dispatched fallback mode. This properly handles the Conjugate and Negative dispatch keys, if present, in exchange for a performance pessimization in complex arithmetic.

ghstack-source-id: 46b9be7
Pull Request resolved: #143223
[ghstack-poisoned]
benjaminglass1 added a commit that referenced this pull request Dec 17, 2024
When calling a fallback op in cpp_wrapper mode, where any of the inputs are complex numbers, utilize the runtime dispatched fallback mode. This properly handles the Conjugate and Negative dispatch keys, if present, in exchange for a performance pessimization in complex arithmetic.

ghstack-source-id: d8ff9b1
Pull Request resolved: #143223
[ghstack-poisoned]
@benjaminglass1 benjaminglass1 marked this pull request as ready for review December 18, 2024 22:55
@benjaminglass1 benjaminglass1 requested a review from a team as a code owner December 18, 2024 22:55
[ghstack-poisoned]
[ghstack-poisoned]
fightingand pushed a commit to fightingand/pytorch that referenced this pull request Dec 20, 2024
When calling a fallback op in cpp_wrapper mode, where any of the inputs are complex numbers, utilize the runtime dispatched fallback mode. This properly handles the Conjugate and Negative dispatch keys, if present, in exchange for a performance pessimization in complex arithmetic.

ghstack-source-id: 409133d
Pull Request resolved: pytorch/pytorch#143223
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@benjaminglass1
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 2, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@benjaminglass1 benjaminglass1 removed ciflow/trunk Trigger trunk jobs on your pull request merging labels Jan 2, 2025
[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Jan 3, 2025
Removes 4 fallback ops that are currently not possible to codegen, which does not break ABI-compatibility.

1. `_cudnn_rnn_backward` and `_histogramdd_bin_edges` both return `Tensor[]`, which we cannot codegen with the current design.
2. `_sparse_coo_tensor_with_dims_and_tensors` only supplies a Sparse operator, which we don't support.
3. `zeros.names` requires a `Dimname` input, which we can't currently codegen.

Removing these ops from the list will improve test performance, since the fallback op generation will use the Python proxy executor instead of calling non-existent C functions.

Pull Request resolved: #143421
Approved by: https://github.com/desertfire
ghstack dependencies: #141371, #143223
etaf added a commit that referenced this pull request Jan 6, 2025
etaf added a commit that referenced this pull request Jan 6, 2025
fft to CPU.

ghstack-source-id: 95da949
Pull Request resolved: #144238
pytorchmergebot pushed a commit that referenced this pull request Jan 8, 2025
Since #143223 enabled runtime dispatch for fft_c2c in AOTI mod, for XPU, we can fallback fft_c2c which has no XPU implementation to CPU and pass the case now.

Pull Request resolved: #144238
Approved by: https://github.com/jansel
@github-actions github-actions bot deleted the gh/benjaminglass1/41/head branch February 3, 2025 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants