-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ARROW-11905: [C++] Fix SIMD detection on macOS #9657
Conversation
👀 |
It works! Thanks This is with the R code from #9641, but c++ from this branch: jkeane@het r % R -e "arrow:::runtime_info()"
> arrow:::runtime_info()
[1] "avx" "avx"
>
jkeane@het r % ARROW_USER_SIMD_LEVEL=sse4_2 R -e "arrow:::runtime_info()"
> arrow:::runtime_info()
[1] "sse4_2" "avx"
> |
What CPU do you have, by the way? |
On the system I ran that I've got an Intel Xeon CPU E5-1650 v2 |
Indeed, it doesn't have AVX2. Thank you! |
88d58fd
to
16e8abf
Compare
cpp/src/arrow/util/cpu_info.cc
Outdated
{"hw.optional.avx512cd", AVX512CD}, | ||
{"hw.optional.avx512dq", AVX512DQ}, | ||
{"hw.optional.avx512bw", AVX512BW}, | ||
{"hw.optional.avx512vl", AVX512VL}, |
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.
Also add M1 arm64 flags?
{"hw.optional.neon", ASIMD}
I haven't tested this flag myself, just references golang/go#42747 (comment)
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.
Can do :-) By the way, is there a difference between "Neon" and "ASIMD"?
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.
Also, here are the available values on a M1:
https://gist.github.com/pitrou/fa1527038fea2d7a4cf367ecba7a2d2c
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.
Per my knowledge, NEON
exists since 32 bit Arm, and ASIMD
extends it to 64 bit system, with additional instructions and wider registers. ASIMD
should be the correct term for Arm64 world, but obviously NEON
is well known and widely used.
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.
Double checked with an expert from Arm. Actually Neon == Advanced SIMD.
From Arm Architecture Reference Manual (ArmARM):
The Advanced SIMD architecture, its associated implementations, and supporting software, are commonly referred to as NEON™ technology".
Neon
was the codename that became public and more commonly used than the "proper name" (Advanced SIMD).
16e8abf
to
a397fc3
Compare
On an M1 I get the following output for
Different Uwe in that handle ;) |
Thank you @xhochy . |
Also, can you try under Rosetta? |
Also not mentioned on the manpage on the actual system. In general, I have the feeling that near to none of the internal workings / changes of macos-on-M1 vs macos-on-Intel has been published yet. |
0d67690
to
662182a
Compare
For 662182a: Rosetta 2:
Native:
|
Ok, thank you. So it seems to work now. I'll wait for CI and then merge. |
Shouldn't native show |
|
Closes apache#9657 from pitrou/ARROW-11905-macos-simd-detect Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
Closes apache#9657 from pitrou/ARROW-11905-macos-simd-detect Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
No description provided.