8000 fix sigmoid for torch.complex datatypes on CPU by jiayisunx · Pull Request #140391 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

fix sigmoid for torch.complex datatypes on CPU #140391

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
wants to merge 9 commits into from

Conversation

jiayisunx
Copy link
Collaborator
@jiayisunx jiayisunx commented Nov 12, 2024

Stack from ghstack (oldest at bottom):

Fix #135777.
This issue is caused by the lack of special handling of the case where the real number/imag number is 0/Inf/NaN in the vectorized implementation of reciprocal. For correctness, I temporarily fallback the implementation of reciprocal to scalar implementation.

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @ezyang @anjali411 @dylanbespalko @mruberry @nikitaved @amjames

[ghstack-poisoned]
Copy link
pytorch-bot bot commented Nov 12, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 7edb584 with merge base 6cb186e (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added the module: cpu CPU specific problem (e.g., perf, algorithm) label Nov 12, 2024
jiayisunx added a commit that referenced this pull request Nov 12, 2024
ghstack-source-id: 72c7517
Pull Request resolved: #140391
@jiayisunx jiayisunx marked this pull request as draft November 12, 2024 11:24
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@jiayisunx jiayisunx added module: complex Related to complex number support in PyTorch release notes: complex release notes category and removed module: complex Related to complex number support in PyTorch labels Nov 13, 2024
jiayisunx added a commit that referenced this pull request Nov 13, 2024
ghstack-source-id: 2fe41c1
Pull Request resolved: #140391
@jiayisunx jiayisunx marked this pull request as ready for review November 13, 2024 08:08
@jiayisunx jiayisunx requested a review from mruberry as a code owner November 13, 2024 08:08
@ezyang
Copy link
Contributor
ezyang commented Nov 14, 2024

This just undoes the vectorization. Is it hard to fix the vectorized implementation?

[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Nov 19, 2024
ghstack-source-id: 925bd62
Pull Request resolved: #140391
[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Nov 20, 2024
ghstack-source-id: 82115c1
Pull Request resolved: #140391
@jiayisunx
Copy link
Collaborator Author

This just undoes the vectorization. Is it hard to fix the vectorized implementation?

Hi @ezyang , I think this is not easy. The problem is that in the scalar implementation of asin there are special handling for the case where real/imag numbers are 0/Inf/NaN, but these special handling for 0/Inf/NaN are missing in the vectorized implementation, which is not easy to do. For correctness, I will temporarily revert the implementation of asin to a scalar implementation.

@jiayisunx jiayisunx requested a review from mingfeima January 6, 2025 06:40
@jiayisunx jiayisunx added the ciflow/trunk Trigger trunk jobs on your pull request label Jan 6, 2025
[ghstack-poisoned]
[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Jan 6, 2025
ghstack-source-id: e0ae5d0
Pull Request resolved: #140391
@jiayisunx
Copy link
Collaborator Author
jiayisunx commented Jan 15, 2025

hi @Skylion007 , could you please review this PR? thanks!

@jiayisunx jiayisunx requested a review from Skylion007 January 15, 2025 09:46
[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Jan 20, 2025
ghstack-source-id: d304ab9
Pull Request resolved: #140391
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 03:40 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 03:40 Inactive
@pytorch-bot pytorch-bot bot temporarily deployed to upload-benchmark-results January 20, 2025 03:40 Inactive
@jiayisunx
Copy link
Collaborator Author

@pytorchbot merge

@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

@github-actions github-actions bot deleted the gh/jiayisunx/40/head branch February 20, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your 548F pull request Merged module: cpu CPU specific problem (e.g., perf, algorithm) open source release notes: complex release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0