-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
apache-arrow: set optimization to O2 #94958
Conversation
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!
🤖 A scheduled task has triggered a merge. |
If this fixes the issue of emitting an unsupported instruction, this is purely by chance, right? |
That's true -- that's why this is a workaround -- but it's not clear why BMI2 is being enabled at compile time. The most likely explanations to me are that there is either a bug in the Arrow build system, or there is a bug in the toolchain. |
We now have a working reproducer on CI without Homebrew involved. And it seems quite likely that it's a compiler bug: clang emits a BMI2 instruction even though only The relevant log line is this one and there's nothing there that should enable BMI2: |
Interesting. Have you worked out which versions of Clang are affected? Does it affect GCC? (It probably doesn't.) |
I don't have a Mac myself, I only have access to CI which is a bit painful for experimentation. So for now the affected version would be "AppleClang 13.0.0.13000029" :-) |
Does this not reproduce with Clang on Linux? Interesting. |
Hmm, I will try on Linux with the versions of clang I have here. |
I was not able to reproduce with either clang 10.0.0-4ubuntu1 or 12.0.0-3ubuntu1~20.04.4, with only Perhaps Apple's version of clang carries some unofficial patches or is branched off a development version of clang? |
You could try a newer Clang (13) in CI by setting
|
(also note I didn't find any matching bug report on the LLVM bug trackers) |
Hm. Weird. Can you try passing |
Not really, because CMake here is hidden behind some non-trivial R build scripts, hence my question to @jonkeane . |
You can probably add it here: https://github.com/ursacomputing/crossbow/blob/0f75c8c6df77cb7316f99bd716e9784921868aeb/.github/workflows/crossbow.yml#L35 You'll need to interpolate |
Ok, I've added the necessary bits to ensure that R is using the newer clang (it wraps or overrides those env vars, and there's a slightly different way to specify them). I'm pretty sure that this is picking up the right (newer) version of clang:
https://github.com/ursacomputing/crossbow/runs/5201239603?check_suite_focus=true#step:8:83 Though we still get the segfault: https://github.com/ursacomputing/crossbow/runs/5201239603?check_suite_focus=true#step:10:8126 |
Well, if someone wants to experiment more and has an appropriately-configured macOS machine, they can try to reproduce some of the command line here: https://github.com/ursacomputing/crossbow/runs/5201239603?check_suite_focus=true#step:8:1691 and see whether the generated objdump --demangle --disassemble level_conversion.cc.o | grep shl
# `shlx` is BMI2, `shl` and `shlq` are not Myself, I cannot go any further. |
@jonkeane can you try this with |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?This is the workaround proposed in #94724 and I've confirmed that it works with apache-arrow's (extended) CI at apache/arrow#12364 (comment)