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

Skip to content

Disable NEON acceleration on older compilers #47099

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

malfet
Copy link
Contributor

@malfet malfet commented Oct 30, 2020

Optimized build compiled by gcc-7.5.0 generates numerically incorrect code

Works around #47098

Optimized build compiled by gcc-7.5.0 generates numerically incorrect code
@malfet malfet requested review from kimishpatel and a team October 30, 2020 03:39
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #47099 into master will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #47099      +/-   ##
==========================================
- Coverage   68.85%   68.85%   -0.01%     
==========================================
  Files         436      436              
  Lines       56395    56395              
==========================================
- Hits        38833    38832       -1     
- Misses      17562    17563       +1     

@walterddr
Copy link
Contributor

tbh it doesn't look like using any neon intrinsic acceleration for hypot anyway.

@kimishpatel
Copy link
Contributor

Right so hypot just falls back std::hypot. Can we confirm that std::hypot is broken on older gcc for sanity check. Also is this all older versions of gcc <=7.5 or specifically 7.5.

Also can we hold off on this PR. I need to confirm if this has implication elsewhere if we are using gcc toolchain with older version to build stuff.

Copy link
Contributor

@kimishpatel kimishpatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to confirm if this is a safe change or we might see perf regressions.

@kimishpatel
Copy link
Contributor

Right so hypot just falls back std::hypot. Can we confirm that std::hypot is broken on older gcc for sanity check. Also is this all older versions of gcc <=7.5 or specifically 7.5.

Also can we hold off on this PR. I need to confirm if this has implication elsewhere if we are using gcc toolchain with older version to build stuff.

Also since it is not using any intrinsics, if std::hypot itself is broken then I am vary of fixing it here.

@kimishpatel
Copy link
Contributor

I need to confirm if this is a safe change or we might see perf regressions.

I think we are good to go here. Folks building with older gcc for arm64 will not see perf gains unfortunately.

@kimishpatel
Copy link
Contributor

Also looks like without this pr we fallback to Sleef_hypotf8_u05, so std::hypot question still remains.

Copy link
Contributor

@kimishpatel kimishpatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving but question about std::hypot is still unresolved.

@malfet
Copy link
Contributor Author

malfet commented Oct 30, 2020

@kimishpatel , std::hypot works fine, but at::vec256<float>::sqrt() doesn't, which is the reason why I want to disable neon using older compilers.

@kimishpatel
Copy link
Contributor

@kimishpatel , std::hypot works fine, but at::vec256<float>::sqrt() doesn't, which is the reason why I want to disable neon using older compilers.

@malfet, I thought the issue was hypot. But if sqrt is the issue then this intrinsic vsqrtq_f32 is broken. If you have a minimal repro that would be good. Repro is issue #47098 refers to hypot. There are some arm builds which use GCC7 I think: #43265.

@malfet malfet deleted the malfet/disable-neon-if-compiled-by-older-gcc branch October 30, 2020 21:04
@facebook-github-bot
Copy link
Contributor

@malfet merged this pull request in c86af4a.

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