You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[R][C++][Packaging] Illegal opcode error on aggregate Array/ChunkedArray of integer #28343
David Li / @lidavidm:
According to a disassembler, it's crashing on an AVX512 instruction, so maybe Arrow is picking the wrong SIMD level, or was built with the wrong flags:
The backtrace ends at arrow::compute::aggregate::MeanImpl<arrow::Int32Type, (arrow::compute::SimdLevel::type)4>::Finalize and SimdLevel = 4 corresponds to AVX512.
Ian Cook / @ianmcook:
[~frank.du] we are seeing false positives for AVX512 support on Intel Macs running Big Sur. Do you know what might be causing this? Thank you.
or to ensure it will work with older Macs that don't support AVX2 but can still run Big Sur (e.g. older Mac Pros) maybe we should set it to SSE4_2.
On my macpro (late 2013) I have AVX1.0 (though it's not in machdep.cpu.leaf7_features it is in machdep.cpu.features. I'm not sure if there are any big sur compatible machines that don't have avx 1
jkeane@hetarrow % sysctl -a | grepmachdep.cpu.featuresmachdep.cpu.features: FPUVMEDEPSETSCMSRPAEMCECX8APICSEPMTRRPGEMCACMOVPATPSE36CLFSHDSACPIMMXFXSRSSESSE2SSHTTTMPBESSE3PCLMULQDQDTES64MONDSCPLVMXSMXESTTM2SSSE3CX16TPRPDCMSSE4.1SSE4.2x2APICPOPCNTAESPCIDXSAVEOSXSAVETSCTMRAVX1.0RDRANDF16C
Jeroen / @jeroen:
I am also seeing a crash in the R, when we build the R package on big sur using the big-sur autobrew bottles. OTOH binaries for MacOS 10.11-10.15 seem fine. Running the unit tests dies like this (attached the Console stack trace from macos: big-sur-crash.txt).
Neal Richardson / @nealrichardson: @jeroen thanks. This is on an Intel mac, to be clear? (IIRC we thought the other issue was about Rosetta emulation.)
The crash does not happen on M1. It also does not happen if we use binaries compiled on macos 10.13 (which is the CRAN default). It only happens when using arrow built under big sur.
Carlo Cabrera:
I've merged a fix that disables the filtering of -march flags in the Arrow build in Homebrew/core. This should hopefully fix this issue with the Homebrew formula.
I hope you have your runtime detection working correctly for everything that Arrow builds – otherwise we might have to just disable AVX512 on the formula entirely.
I'm particularly concerned about vendored dependencies being tuned for the build-time CPU. (If they're not, they're probably being built for Penryn, which I'll note is a step down from what the Homebrew formula used to build them for.)
Todd Farmer / @toddfarmer:
This issue was last updated over 90 days ago, which may be an indication it is no longer being actively worked. To better reflect the current state, the issue is being unassigned. Please feel free to re-take assignment of the issue if it is being actively worked, or if you plan to start that work soon.
Activity
asfimport commentedon Apr 29, 2021
David Li / @lidavidm:
According to a disassembler, it's crashing on an AVX512 instruction, so maybe Arrow is picking the wrong SIMD level, or was built with the wrong flags:
The backtrace ends at
arrow::compute::aggregate::MeanImpl<arrow::Int32Type, (arrow::compute::SimdLevel::type)4>::FinalizeandSimdLevel = 4corresponds to AVX512.asfimport commentedon Apr 30, 2021
Ian Cook / @ianmcook:
Setting
-DARROW_RUNTIME_SIMD_LEVEL=AVX2in the Homebrew formula (apache-arrow.rb) stops this errorAs a band-aid fix, I can add this to the formula:
or to ensure it will work with older Macs that don't support AVX2 but can still run Big Sur (e.g. older Mac Pros) maybe we should set it to
SSE4_2.asfimport commentedon Apr 30, 2021
Neal Richardson / @nealrichardson:
Is arrow picking the wrong runtime SIMD level? This should be available from R in
arrow_info().Or do we have runtime-dispatched AVX512 code that is flagged as AVX2?
Or something else?
asfimport commentedon Apr 30, 2021
Ian Cook / @ianmcook:
When I build libarrow with
using
apache-arrow.rbdownloaded from https://github.com/Homebrew/homebrew-core/blob/master/Formula/apache-arrow.rb,arrow_info()reports:The same happens if I modify
apache-arrow.rbto and add-DARROW_RUNTIME_SIMD_LEVEL=MAXor-DARROW_RUNTIME_SIMD_LEVEL=AVX2.So it seems like there is an AVX512 instruction being executed when it shouldn't.
asfimport commentedon Apr 30, 2021
Ian Cook / @ianmcook:
Possibly related issues:
ARROW-9643
ARROW-9668
ARROW-9877
ARROW-10321
asfimport commentedon Apr 30, 2021
Ian Cook / @ianmcook:
[~frank.du] we are seeing false positives for AVX512 support on Intel Macs running Big Sur. Do you know what might be causing this? Thank you.
asfimport commentedon Apr 30, 2021
Jonathan Keane / @jonkeane:
On my macpro (late 2013) I have AVX1.0 (though it's not in
machdep.cpu.leaf7_featuresit is inmachdep.cpu.features. I'm not sure if there are any big sur compatible machines that don't have avx 1And
arrow_info()seems to catch that:asfimport commentedon May 3, 2021
Jeroen / @jeroen:
I am also seeing a crash in the R, when we build the R package on big sur using the big-sur autobrew bottles. OTOH binaries for MacOS 10.11-10.15 seem fine. Running the unit tests dies like this (attached the Console stack trace from macos: big-sur-crash.txt).
This seems a lot like https://issues.apache.org/jira/browse/ARROW-11217 which also involved
arrow::compute::aggregate::SumImpl()asfimport commentedon May 3, 2021
Neal Richardson / @nealrichardson:
@jeroen thanks. This is on an Intel mac, to be clear? (IIRC we thought the other issue was about Rosetta emulation.)
asfimport commentedon May 3, 2021
Jeroen / @jeroen:
@nealrichardson Yes indeed, ARROW-11217 would crash under the intel emulator but now we get the crash on native intel hardware.
The crash does not happen on M1. It also does not happen if we use binaries compiled on macos 10.13 (which is the CRAN default). It only happens when using arrow built under big sur.
asfimport commentedon May 4, 2021
Ian Cook / @ianmcook:
Discussion about this also at Homebrew/homebrew-core#76537
asfimport commentedon May 16, 2021
Webb Phillips:
Same problem occurs after updating the MacPorts apache-arrow Portfile to apache-arrow-4.0.0.
asfimport commentedon May 16, 2021
Neal Richardson / @nealrichardson:
For what it's worth, we don't maintain or test the MacPorts formula (I honestly didn't know macports was still a thing). I see https://github.com/macports/macports-ports/blob/master/devel/apache-arrow/Portfile exists but it still says 3.0.0.
asfimport commentedon Jul 5, 2021
Carlo Cabrera:
I've merged a fix that disables the filtering of
-marchflags in the Arrow build in Homebrew/core. This should hopefully fix this issue with the Homebrew formula.I hope you have your runtime detection working correctly for everything that Arrow builds – otherwise we might have to just disable AVX512 on the formula entirely.
I'm particularly concerned about vendored dependencies being tuned for the build-time CPU. (If they're not, they're probably being built for Penryn, which I'll note is a step down from what the Homebrew formula used to build them for.)
asfimport commentedon Jul 12, 2022
Todd Farmer / @toddfarmer:
This issue was last updated over 90 days ago, which may be an indication it is no longer being actively worked. To better reflect the current state, the issue is being unassigned. Please feel free to re-take assignment of the issue if it is being actively worked, or if you plan to start that work soon.