8000 SIMD: Fix Highway QSort symbol linking error on aarch32/ASIMD by seiko2plus · Pull Request #28671 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

SIMD: Fix Highway QSort symbol linking error on aarch32/ASIMD #28671

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
Apr 9, 2025

Conversation

seiko2plus
Copy link
Member

The fix in numpy/meson#12 for ASIMD*(32-bit) compile-time feature detection revealed a new
build error on aarch32 platforms:

ImportError: /numpy/build-install/usr/lib/python3/dist-packages/numpy/_core/
_multiarray_umath.cpython-310-arm-linux-gnueabihf.so: undefined symbol:
_ZN2np7highway10qsort_simd11QSort_ASIMDIjEEvPT_i

This patch prevents platform detection constants of Highway from being exposed across
translation units with different compiler flags (baseline). This approach
eliminates detection mismatches that were causing symbol resolution failures
in the Highway QSort implementation.

relates numpy/meson#12

@seiko2plus seiko2plus added 00 - Bug component: SIMD Issues in SIMD (fast instruction sets) code or machinery labels Apr 8, 2025
@seiko2plus seiko2plus added the 09 - Backport-Candidate PRs tagged should be backported label Apr 8, 2025
  The fix in numpy/meson#12 for ASIMD*(32-bit) compile-time feature detection revealed a new
  build error on aarch32 platforms:

    ImportError: /numpy/build-install/usr/lib/python3/dist-packages/numpy/_core/
    _multiarray_umath.cpython-310-arm-linux-gnueabihf.so: undefined symbol:
    _ZN2np7highway10qsort_simd11QSort_ASIMDIjEEvPT_i

  This patch prevents platform detection constants of Highway from being exposed across
  translation units with different compiler flags (baseline). This approach
  eliminates detection mismatches that were causing symbol resolution failures
  in the Highway QSort implementation.
@seiko2plus seiko2plus force-pushed the fix_highway_qsort_arm32 branch from 6d9a2b1 to d634e51 Compare April 8, 2025 11:48
@seiko2plus seiko2plus requested a review from Mousius April 8, 2025 11:48
Copy link
Member
@Mousius Mousius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit unfortunate to have the extra levels of indirection, but I think fixing the symbol issue takes precedence 😸

@seiko2plus
Copy link
Member Author

It's a bit unfortunate to have the extra levels of indirection

Thanks for review. Agreed. Ideally we'd avoid dispatching when VQSORT_ENABLED is false, but the current fix still lets the compiler optimize better than the baseline flags.

@seiko2plus seiko2plus merged commit b7b368a into numpy:main Apr 9, 2025
72 checks passed
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
00 - Bug component: SIMD Issues in SIMD (fast instruction sets) code or machinery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0