Skip to content

BUG, SIMD: Fix quicksort build error when Highway/SVE is enabled #25397

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

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

seiko2plus
Copy link
Member

@seiko2plus seiko2plus commented Dec 14, 2023

Update Highway against the latest origin commit to fix SVE build errors that appears after #25247:

Build errors triggered by cirrus-ci
FAILED: numpy/_core/libhighway_qsort.dispatch.h_SVE.a.p/src_npysort_highway_qsort.dispatch.cpp.o 
ccache c++ -Inumpy/_core/libhighway_qsort.dispatch.h_SVE.a.p -Inumpy/_core -I../numpy/_core -Inumpy/_core/include -I../numpy/_core/include -I../numpy/_core/src/common -I../numpy/_core/src/multiarray -I../numpy/_core/src/npymath -I../numpy/_core/src/umath -I../numpy/_core/src/highway -I/usr/include/python3.10 -I/usr/include/aarch64-linux-gnu/python3.10 -I/tmp/cirrus-ci-build/build/meson_cpu -fdiagnostics-color=always -Wall -Winvalid-pch -std=c++17 -O2 -g -fPIC -DNPY_INTERNAL_BUILD -DHAVE_NPY_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D__STDC_VERSION__=0 -fno-exceptions -fno-rtti -O3 -DNPY_HAVE_NEON_VFPV4 -DNPY_HAVE_NEON_FP16 -DNPY_HAVE_NEON -DNPY_HAVE_ASIMD -DNPY_HAVE_ASIMDHP -DNPY_HAVE_SVE -march=armv8.2-a+sve+fp16 -DNPY_MTARGETS_CURRENT=SVE -MD -MQ numpy/_core/libhighway_qsort.dispatch.h_SVE.a.p/src_npysort_highway_qsort.dispatch.cpp.o -MF numpy/_core/libhighway_qsort.dispatch.h_SVE.a.p/src_npysort_highway_qsort.dispatch.cpp.o.d -o numpy/_core/libhighway_qsort.dispatch.h_SVE.a.p/src_npysort_highway_qsort.dispatch.cpp.o -c ../numpy/_core/src/npysort/highway_qsort.dispatch.cpp
In file included from ../numpy/_core/src/highway/hwy/highway.h:418,
                 from ../numpy/_core/src/highway/hwy/contrib/algo/copy-inl.h:28,
                 from ../numpy/_core/src/highway/hwy/contrib/sort/vqsort-inl.h:95,
                 from ../numpy/_core/src/npysort/highway_qsort.dispatch.cpp:3:
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h: In substitution of ‘template<class V> using DFromV = typename hwy::N_SVE::DFromV_t<typename hwy::RemoveConstT<T>::type>::type [with V = __SVBfloat16_t]’:
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:771:27:   required from here
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:59:7: error: no type named ‘type’ in ‘struct hwy::N_SVE::DFromV_t<__SVBfloat16_t>’
   59 | using DFromV = typename DFromV_t<RemoveConst<V>>::type;
      |       ^~~~~~
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h: In function ‘hwy::N_SVE::VBF16 hwy::N_SVE::Neg(hwy::N_SVE::VBF16)’:
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:771:29: error: uninitialized ‘const d’ [-fpermissive]
  771 |   const DFromV<decltype(v)> d;
      |                             ^
In file included from ../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:21,
                 from ../numpy/_core/src/highway/hwy/highway.h:418,
                 from ../numpy/_core/src/highway/hwy/contrib/algo/copy-inl.h:28,
                 from ../numpy/_core/src/highway/hwy/contrib/sort/vqsort-inl.h:95,
                 from ../numpy/_core/src/npysort/highway_qsort.dispatch.cpp:3:
../numpy/_core/src/highway/hwy/ops/shared-inl.h: In substitution of ‘template<class D> using RebindToUnsigned = hwy::N_SVE::Rebind<typename hwy::detail::Relations<typename D::T>::Unsigned, D> [with D = const int]’:
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:772:37:   required from here
../numpy/_core/src/highway/hwy/ops/shared-inl.h:465:7: error: ‘const int’ is not a class, struct, or union type
  465 | using RebindToUnsigned = Rebind<MakeUnsigned<TFromD<D>>, D>;
      |       ^~~~~~~~~~~~~~~~
In file included from ../numpy/_core/src/highway/hwy/highway.h:418,
                 from ../numpy/_core/src/highway/hwy/contrib/algo/copy-inl.h:28,
                 from ../numpy/_core/src/highway/hwy/contrib/sort/vqsort-inl.h:95,
                 from ../numpy/_core/src/npysort/highway_qsort.dispatch.cpp:3:
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:772:39: error: uninitialized ‘const du’ [-fpermissive]
  772 |   const RebindToUnsigned<decltype(d)> du;
      |                                       ^~
In file included from ../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:21,
                 from ../numpy/_core/src/highway/hwy/highway.h:418,
                 from ../numpy/_core/src/highway/hwy/contrib/algo/copy-inl.h:28,
                 from ../numpy/_core/src/highway/hwy/contrib/sort/vqsort-inl.h:95,
                 from ../numpy/_core/src/npysort/highway_qsort.dispatch.cpp:3:
../numpy/_core/src/highway/hwy/ops/shared-inl.h: In substitution of ‘template<class D> using TFromD = typename D::T [with D = const int]’:
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:773:33:   required from here
../numpy/_core/src/highway/hwy/ops/shared-inl.h:426:7: error: ‘const int’ is not a class, struct, or union type
  426 | using TFromD = typename D::T;
      |       ^~~~~~
In file included from ../numpy/_core/src/highway/hwy/highway.h:418,
                 from ../numpy/_core/src/highway/hwy/contrib/algo/copy-inl.h:28,
                 from ../numpy/_core/src/highway/hwy/contrib/sort/vqsort-inl.h:95,
                 from ../numpy/_core/src/npysort/highway_qsort.dispatch.cpp:3:
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:774:32: error: no matching function for call to ‘BitCast(const int&, hwy::N_SVE::VBF16&)’
  774 |   return BitCast(d, Xor(BitCast(du, v), Set(du, SignMask<TU>())));
      |                         ~~~~~~~^~~~~~~
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:441:19: note: candidate: ‘template<class D, class FromV> hwy::N_SVE::VFromD<D> hwy::N_SVE::BitCast(D, FromV)’
  441 | HWY_API VFromD<D> BitCast(D d, FromV v) {
      |                   ^~~~~~~
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:441:19: note:   template argument deduction/substitution failed:
In file included from ../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:21,
                 from ../numpy/_core/src/highway/hwy/highway.h:418,
                 from ../numpy/_core/src/highway/hwy/contrib/algo/copy-inl.h:28,
                 from ../numpy/_core/src/highway/hwy/contrib/sort/vqsort-inl.h:95,
                 from ../numpy/_core/src/npysort/highway_qsort.dispatch.cpp:3:
../numpy/_core/src/highway/hwy/ops/shared-inl.h: In substitution of ‘template<class D> using TFromD = typename D::T [with D = int]’:
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:376:34:   required by substitution of ‘template<class D> using VFromD = decltype (hwy::N_SVE::Set(D(), hwy::N_SVE::TFromD<D>())) [with D = int]’
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:441:19:   required by substitution of ‘template<class D, class FromV> hwy::N_SVE::VFromD<D> hwy::N_SVE::BitCast(D, FromV) [with D = int; FromV = __SVBfloat16_t]’
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:774:32:   required from here
../numpy/_core/src/highway/hwy/ops/shared-inl.h:426:7: error: ‘int’ is not a class, struct, or union type
  426 | using TFromD = typename D::T;
      |       ^~~~~~
In file included from ../numpy/_core/src/highway/hwy/highway.h:418,
                 from ../numpy/_core/src/highway/hwy/contrib/algo/copy-inl.h:28,
                 from ../numpy/_core/src/highway/hwy/contrib/sort/vqsort-inl.h:95,
                 from ../numpy/_core/src/npysort/highway_qsort.dispatch.cpp:3:
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:774:58: error: ‘TU’ was not declared in this scope
  774 |   return BitCast(d, Xor(BitCast(du, v), Set(du, SignMask<TU>())));
      |                                                          ^~
../numpy/_core/src/highway/hwy/ops/arm_sve-inl.h:774:61: error: no matching function for call to ‘SignMask<<expression error> >()’
  774 |   return BitCast(d, Xor(BitCast(du, v), Set(du, SignMask<TU>())));

@charris's comment within #25346
This looks to have broken linux aarch64 builds: https://cirrus-ci.com/task/6261480706801664.

@seiko2plus seiko2plus added the component: SIMD Issues in SIMD (fast instruction sets) code or machinery label Dec 14, 2023
  Update Highway against the latest commit to SVE compile errors
@seiko2plus seiko2plus force-pushed the update_highway_or_revert_25247 branch from c316be5 to 796e075 Compare December 14, 2023 19:52
@seiko2plus seiko2plus changed the title MAINT: Fix quicksort build error when Highway/SVE is enabled BUG, SIMD: Fix quicksort build error when Highway/SVE is enabled Dec 14, 2023
@seiko2plus seiko2plus added 00 - Bug 36 - Build Build related PR and removed 03 - Maintenance labels Dec 14, 2023
@seiko2plus seiko2plus marked this pull request as ready for review December 14, 2023 20:02
@seiko2plus
Copy link
Member Author

These build errors was reported by google/highway#1888 and fixed by google/highway#1891

@seiko2plus
Copy link
Member Author

ping @charris

@charris charris merged commit faa21dd into numpy:main Dec 14, 2023
@charris
Copy link
Member

charris commented Dec 14, 2023

Thanks Sayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug 36 - Build Build related PR component: SIMD Issues in SIMD (fast instruction sets) code or machinery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants