jeffdaily / parasail-python

Python bindings for the parasail C library.
Other
87 stars 17 forks source link

Test failures on arm64 #56

Open nileshpatra opened 3 years ago

nileshpatra commented 3 years ago

Hi, currently the tests for parasail-python segfault on arm64. I've no clue for the reason behind it. Please consider fixing it at the earliest.

Log:

I: pybuild base:232: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.9/build; python3.9 -m pytest tests
============================= test session starts ==============================
platform linux -- Python 3.9.1rc1, pytest-4.6.11, py-1.9.0, pluggy-0.13.0
rootdir: /<<PKGBUILDDIR>>
collected 16 items

tests/test_basic.py ...Segmentation fault
E: pybuild pybuild:353: test: plugin distutils failed with: exit code=139: cd /
nileshpatra commented 3 years ago

cc: @iiSeymour @jeffdaily

jeffdaily commented 3 years ago

Can you confirm whether any vector ISA was found during the build process? When I tried adding more manylinux builds, I started seeing this seg fault as well. My initial hunch is that no vectorized instructions were detected during configuration of the C library, and the test_basic.py tries to make use of a vectorized routine that doesn't exist. It's just a hunch at the moment.

nileshpatra commented 3 years ago

Hi,

Can you confirm whether any vector ISA was found during the build process?

How do I check that exactly? (I didn't see anything unusual in the build log)

You can find complete logs here:

http://qa-logs.debian.net/2020/12/05/python-parasail_1.2.1-1_unstable.log

When I tried adding more manylinux builds, I started seeing this seg fault as well. My initial hunch is that no vectorized instructions were detected during configuration of the C library, and the test_basic.py tries to make use of a vectorized routine that doesn't exist. It's just a hunch at the moment.

Does it use SIMD intrinsics specific to only amd64 at some places?

eamanu commented 3 years ago

Hi @jeffdaily,

Any update about this issue? :)

Thanks!

jeffdaily commented 3 years ago

Though this issue is filed under the python bindings, it's really an issue with the C library. It seems that on some platforms parasail is failing to find a vector ISA that it can compile for. This is a build-time check. Then there's a bug in parasail's ISA dispatcher where it doesn't have a graceful fallback when no vector ISA is available, and seg faults.

I think I've got a fix to add the graceful fallback in the C library. But I'm just as concerned that the fallback would hide the fact a vector ISA wasn't found. That would be hiding a performance bug. I don't have a solution for that one yet.

cjw85 commented 9 months ago

@jeffdaily,

I was looking to add linux aarch64 wheels to the CI. Should this be trivially possible now?

jeffdaily commented 9 months ago

Should be? I would just double-check the logs and make sure it's still picking up neon as the vector ISA. Contributions welcome.