-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[BE] Use __builtin_overflow_sub
when available
#117015
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
Conversation
Which is faster then ternary. On x86 following script ```python import torch from timeit import default_timer global_setup = """ """ setup = """ c10::SymInt a = c10::SymInt(123); """ code = """ -a; """ from torch.utils.benchmark import Timer t = Timer(stmt=code, setup=setup, global_setup=global_setup, language="c++", timer=default_timer) print(t.blocked_autorange()) ``` reports 4.17 ns median type before and 3.61 ns after
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/117015
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 65ebc75 with merge base 14be2ee ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
Thanks!
@pytorchbot merge -f "Pull and Windows builds are green and this is a build only change" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Which is faster then ternary. Following script ```python import torch from timeit import default_timer global_setup = """ """ setup = """ c10::SymInt a = c10::SymInt(123); """ code = """ -a; """ from torch.utils.benchmark import Timer t = Timer(stmt=code, setup=setup, global_setup=global_setup, language="c++", timer=default_timer) print(t.blocked_autorange()) ``` reports 4.17 ns median type before and 3.61 ns after on x86_64 Linux and 2.02 ns before and 1.91 ns after on Apple M1 Pull Request resolved: pytorch#117015 Approved by: https://github.com/albanD
Which is faster then ternary.
Following script
reports 4.17 ns median type before and 3.61 ns after on x86_64 Linux and 2.02 ns before and 1.91 ns after on Apple M1