Skip to content

[Python][C++] pyarrow._compute Contains AVX Instructions During Import #49640

@Alvaro-Kothe

Description

@Alvaro-Kothe

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

According to the Arrow C++ environment variables documentation, the default SIMD level is SSE4.2. However, importing pyarrow._compute executes AVX instructions even when running on a CPU that only supports up to SSE4.2.

Reproduction

Setup venv and install pyarrow from PyPI:

$ python -m venv venv && venv/bin/pip install --no-cache pyarrow
... Successfully installed pyarrow-23.0.1

Then run the Python interpreter under QEMU emulating a Westmere CPU (which supports SSE4.2 but not AVX):

$ qemu-x86_64-static -cpu Westmere venv/bin/python -c 'import pyarrow._compute'
qemu: uncaught target signal 4 (Illegal instruction) - core dumped

The disassembly of the coredump shows that it uses AVX instructions.

(gdb) disassemble $pc-16,$pc+16
Dump of assembler code from 0x7f2ff65ceb32 to 0x7f2ff65ceb52:
   0x00007f2ff65ceb32:  push   r12
   0x00007f2ff65ceb34:  push   rbp
   0x00007f2ff65ceb35:  mov    rbp,rdi
   0x00007f2ff65ceb38:  push   rbx
   0x00007f2ff65ceb39:  sub    rsp,0x48
   0x00007f2ff65ceb3d:  call   0x7f2ff5c3c1d0
=> 0x00007f2ff65ceb42:  vmovdqu xmm0,XMMWORD PTR [rax]
   0x00007f2ff65ceb46:  vpextrq rax,xmm0,0x1
   0x00007f2ff65ceb4c:  vmovdqa XMMWORD PTR [rsp+0x10],xmm0

Setting ARROW_USER_SIMD_LEVEL to None or SSE4_2 didn't help.

Edit: I am using Linux x86-64 with Python 3.14.

Component(s)

Python

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions