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
Numerical error introduced using ARM64 using clang-14 but not clang-13 #91824
Comments
Try passing
|
@llvm/issue-subscribers-backend-aarch64 Author: James Douglass (phargogh)
Hello! I am experiencing an issue with clang on ARM64 (reproducible on M1 mac and Raspberry Pi 4B) where chaining a series of mathematical operations together introduces some numerical error. I have a workaround where breaking some of the math onto a second line does not introduce the error. I have tested this on a Raspberry Pi 4B and also on the following debian versions on my M1 mac:
A minimal reproducible sample is here in this gist: https://gist.github.com/phargogh/c4264b37e7f0beed31661eacce53d14a Thank you! |
Thanks @topperc ! I confirm that the behavior is "restored" with Although, I'm a little perplexed about why this behavior is creating different results on ARM64 vs X86_64. Any ideas? |
See llvm/llvm-project#91824 for the thread with the llvm devs. RE:natcap#1562
Because the decision is based on whether the backend thinks FMA is fast. That will always be yes on arm64, and for base x86_64 it will be no. If you use -mfma or target any modernish CPU you'll probably get the fused result |
Thanks for the information! I think my issue is resolved here, so I'll go ahead and close the issue. |
Hello! I am experiencing an issue with clang on ARM64 (reproducible on M1 mac and Raspberry Pi 4B) where chaining a series of mathematical operations together introduces some numerical error. I have a workaround where breaking some of the math onto a second line does not introduce the error. I have tested this on a Raspberry Pi 4B and also on the following debian versions on my M1 mac:
A minimal reproducible sample is here in this gist: https://gist.github.com/phargogh/c4264b37e7f0beed31661eacce53d14a
Thank you!
The text was updated successfully, but these errors were encountered: