Skip to content
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

[C++][Compute] _mm256_set_m128i() is unavailable on OpenSUSE 15.1 (GCC 7.5) #44098

Closed
kou opened this issue Sep 13, 2024 · 8 comments
Closed
Assignees
Milestone

Comments

@kou
Copy link
Member

kou commented Sep 13, 2024

Describe the bug, including details regarding any error messages, version, and platform.

test-r-rstudio-r-base-4.1-opensuse155 is failing with the following error:

https://dev.azure.com/ursacomputing/crossbow/_build/results?buildId=66380&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=6c939d89-0d1a-51f2-8b30-091a7a82e98c&l=1511

/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc: In function ‘uint64_t arrow::compute::CompareSelected8_avx2(const uint8_t*, const uint8_t*, __m256i, __m256i, __m256i, int)’:
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:317:19: error: there are no arguments to ‘_mm256_set_m128i’ that depend on a template parameter, so a declaration of ‘_mm256_set_m128i’ must be available [-fpermissive]
   __m256i right = _mm256_set_m128i(right_hi, right_lo);
                   ^~~~~~~~~~~~~~~~
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:317:35: error: ‘_mm256_set_m128i’ was not declared in this scope
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:317:35: note: suggested alternative: ‘_mm256_set_epi8’
   __m256i right = _mm256_set_m128i(right_hi, right_lo);
                   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
                   _mm256_set_epi8
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc: In instantiation of ‘uint64_t arrow::compute::CompareSelected8_avx2(const uint8_t*, const uint8_t*, __m256i, __m256i, __m256i, int) [with int column_width = 2; uint64_t = long unsigned int; uint8_t = unsigned char; __m256i = __vector(4) long long int]’:
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:502:44:   required from ‘arrow::compute::KeyCompare::CompareBinaryColumnToRowImp_avx2(uint32_t, uint32_t, const uint16_t*, const uint32_t*, arrow::compute::LightContext*, const arrow::compute::KeyColumnArray&, const arrow::compute::RowTableImpl&, uint8_t*)::<lambda(const uint8_t*, const uint8_t*, uint32_t, __m256i, __m256i, __m256i)> [with bool use_selection = true; uint8_t = unsigned char; uint32_t = unsigned int; __m256i = __vector(4) long long int]’
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:499:10:   required from ‘struct arrow::compute::KeyCompare::CompareBinaryColumnToRowImp_avx2(uint32_t, uint32_t, const uint16_t*, const uint32_t*, arrow::compute::LightContext*, const arrow::compute::KeyColumnArray&, const arrow::compute::RowTableImpl&, uint8_t*) [with bool use_selection = true; uint32_t = unsigned int; uint16_t = short unsigned int; uint8_t = unsigned char]::<lambda(const uint8_t*, const uint8_t*, uint32_t, __m256i, __m256i, __m256i)>’
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:496:62:   required from ‘static uint32_t arrow::compute::KeyCompare::CompareBinaryColumnToRowImp_avx2(uint32_t, uint32_t, const uint16_t*, const uint32_t*, arrow::compute::LightContext*, const arrow::compute::KeyColumnArray&, const arrow::compute::RowTableImpl&, uint8_t*) [with bool use_selection = true; uint32_t = unsigned int; uint16_t = short unsigned int; uint8_t = unsigned char]’
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:672:83:   required from here
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:317:35: error: ‘_mm256_set_m128i’ was not declared in this scope
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:317:35: note: suggested alternative: ‘_mm256_set_epi8’
   __m256i right = _mm256_set_m128i(right_hi, right_lo);
                   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
                   _mm256_set_epi8
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc: In instantiation of ‘uint64_t arrow::compute::CompareSelected8_avx2(const uint8_t*, const uint8_t*, __m256i, __m256i, __m256i, int) [with int column_width = 4; uint64_t = long unsigned int; uint8_t = unsigned char; __m256i = __vector(4) long long int]’:
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:516:44:   required from ‘arrow::compute::KeyCompare::CompareBinaryColumnToRowImp_avx2(uint32_t, uint32_t, const uint16_t*, const uint32_t*, arrow::compute::LightContext*, const arrow::compute::KeyColumnArray&, const arrow::compute::RowTableImpl&, uint8_t*)::<lambda(const uint8_t*, const uint8_t*, uint32_t, __m256i, __m256i, __m256i)> [with bool use_selection = true; uint8_t = unsigned char; uint32_t = unsigned int; __m256i = __vector(4) long long int]’
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:513:10:   required from ‘struct arrow::compute::KeyCompare::CompareBinaryColumnToRowImp_avx2(uint32_t, uint32_t, const uint16_t*, const uint32_t*, arrow::compute::LightContext*, const arrow::compute::KeyColumnArray&, const arrow::compute::RowTableImpl&, uint8_t*) [with bool use_selection = true; uint32_t = unsigned int; uint16_t = short unsigned int; uint8_t = unsigned char]::<lambda(const uint8_t*, const uint8_t*, uint32_t, __m256i, __m256i, __m256i)>’
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:510:62:   required from ‘static uint32_t arrow::compute::KeyCompare::CompareBinaryColumnToRowImp_avx2(uint32_t, uint32_t, const uint16_t*, const uint32_t*, arrow::compute::LightContext*, const arrow::compute::KeyColumnArray&, const arrow::compute::RowTableImpl&, uint8_t*) [with bool use_selection = true; uint32_t = unsigned int; uint16_t = short unsigned int; uint8_t = unsigned char]’
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:672:83:   required from here
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:317:35: error: ‘_mm256_set_m128i’ was not declared in this scope
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:317:35: note: suggested alternative: ‘_mm256_set_epi8’
   __m256i right = _mm256_set_m128i(right_hi, right_lo);
                   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
                   _mm256_set_epi8
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc: In instantiation of ‘uint64_t arrow::compute::Compare8_avx2(const uint8_t*, const uint8_t*, uint32_t, __m256i, __m256i, int) [with int column_width = 0; uint64_t = long unsigned int; uint8_t = unsigned char; uint32_t = unsigned int; __m256i = __vector(4) long long int]’:
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:477:36:   required from ‘arrow::compute::KeyCompare::CompareBinaryColumnToRowImp_avx2(uint32_t, uint32_t, const uint16_t*, const uint32_t*, arrow::compute::LightContext*, const arrow::compute::KeyColumnArray&, const arrow::compute::RowTableImpl&, uint8_t*)::<lambda(const uint8_t*, const uint8_t*, uint32_t, __m256i, __m256i, __m256i)> [with bool use_selection = true; uint8_t = unsigned char; uint32_t = unsigned int; __m256i = __vector(4) long long int]’
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:470:10:   required from ‘struct arrow::compute::KeyCompare::CompareBinaryColumnToRowImp_avx2(uint32_t, uint32_t, const uint16_t*, const uint32_t*, arrow::compute::LightContext*, const arrow::compute::KeyColumnArray&, const arrow::compute::RowTableImpl&, uint8_t*) [with bool use_selection = true; uint32_t = unsigned int; uint16_t = short unsigned int; uint8_t = unsigned char]::<lambda(const uint8_t*, const uint8_t*, uint32_t, __m256i, __m256i, __m256i)>’
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:467:62:   required from ‘static uint32_t arrow::compute::KeyCompare::CompareBinaryColumnToRowImp_avx2(uint32_t, uint32_t, const uint16_t*, const uint32_t*, arrow::compute::LightContext*, const arrow::compute::KeyColumnArray&, const arrow::compute::RowTableImpl&, uint8_t*) [with bool use_selection = true; uint32_t = unsigned int; uint16_t = short unsigned int; uint8_t = unsigned char]’
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:672:83:   required from here
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:368:35: error: ‘_mm256_set_m128i’ was not declared in this scope
   __m256i right = _mm256_set_m128i(right_hi, right_lo);
                   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/arrow/cpp/src/arrow/compute/row/compare_internal_avx2.cc:368:35: note: suggested alternative: ‘_mm256_set_epi8’
   __m256i right = _mm256_set_m128i(right_hi, right_lo);
                   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
                   _mm256_set_epi8

GH-43389 may be related.

Component(s)

C++

@zanmato1984
Copy link
Collaborator

By some googling I can find people seeing similar issue, such as [1]. The root cause seems to point to a GCC bug [2], which is claimed to be fixed in 8.0.

I think I do have some workaround in mind. But I want to check first if we are able to upgrade GCC to 8.0 for this particular CI job?

Thanks.

[1] https://gitlab.com/libeigen/eigen/-/issues/2045
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80582

@kou
Copy link
Member Author

kou commented Sep 13, 2024

@assignUser Is R 4.1 still maintained? (Can we remove test-r-rstudio-r-base-4.1-opensuse155?)

@assignUser
Copy link
Member

@kou yes we support the last 4 versions so 4.1 to 4.4

@kou
Copy link
Member Author

kou commented Sep 13, 2024

OK.

@zanmato1984 Could you try a workaround for the platform?

@assignUser
Copy link
Member

Though I am not sure if the opensuse job is really important, it's not an official flavour and tbh I don't think there is a huge R demographic on it... @jonkeane what do you think?

@zanmato1984
Copy link
Collaborator

I filed PR #44116 to workaround it anyway.

@jonkeane
Copy link
Member

I see we already have a PR for that, which is good, but for some added context on why that's good

Though I am not sure if the opensuse job is really important, it's not an official flavour and tbh I don't think there is a huge R demographic on it... @jonkeane what do you think?

It would be good to maintain the matrix of support if we can, I don't know of any other exception to our matrix (i.e. "this works on these versions of R and these OSes, except this version of R + OS combo"), so adding one shouldn't be taken lightly. Additionally + possibly more importantly opensuse is one of the Posit Public Package Manager platforms, so they build there.

pitrou pushed a commit that referenced this issue Sep 17, 2024
…missing it (#44116)

### Rationale for this change

AVX2 intrinsic _mm256_set_m128i is missing in GCC versions <8.0 - this is a GCC bug discussed in [1], causing certain CI build failed.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80582

### What changes are included in this PR?

Check the GCC version and use a home made replacement if necessary.

### Are these changes tested?

Manually tested.

### Are there any user-facing changes?

None.

* GitHub Issue: #44098

Authored-by: Ruoxi Sun <zanmato1984@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
@pitrou pitrou added this to the 18.0.0 milestone Sep 17, 2024
@pitrou
Copy link
Member

pitrou commented Sep 17, 2024

Issue resolved by pull request 44116
#44116

@pitrou pitrou closed this as completed Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants