Skip to content

Conversation

@ev-br
Copy link
Owner

@ev-br ev-br commented Apr 8, 2025

Reference issue

What does this implement/fix?

Additional information

ev-br and others added 30 commits March 10, 2025 12:05
TST: optimize: add test for VectorFunction with sparse_jacobian=False
This makes tests pass under pytest-run-parallel; the logic
was already broken for use of the default build with Python-level
threads (e.g., through the `threading` module) though.
This is per-module global state that wasn't robust against
altering it from separate threads.
Also tweak the refcounting test's skip condition to be more
accurate. It would have failed under Pyston and other interpreters
than CPython and PyPy otherwise.
It's always defined for Python >=3.7, threadless builds no longer
exist.
)

* TST: special: remove test skips due to upstream issue

* MAINT: Update requirements/test.txt

* STY/CI: fix lint, adjust required array-api-strict version
ev-br added 25 commits April 7, 2025 17:40
32-bit LAPACK builds generate the `blas_lapack_wrapper.so` library
which contains trampolines from F_FUNC to BLAS_FUNC mangling
(i.e. create dgemm_ as a synonym for scipy_dgemm_ etc).
Then f2py uses F_FUNC mangled symbols, and which get picked up
from the wrappers.

With ILP64 builds this approach may lead to symbol clashes:
at least the MKL _ilp64.so variants contain two kinds of symbols:
both `dgemm_64_` and `dgemm_`.
We want to only use the former (is dgemm_ 32- or 64-bit?).

Therefore, we instead force the BLAS_FUNC mangling at the f2py level:
inject a 'usercode' section into f2py-generated C files and replace
the F_FUNC define with BLAS_FUNC.
This relies on the fact that f2py includes the usercode section _after_
its F_FUNC define.
@ev-br ev-br force-pushed the ilp64_accelerate branch from 0fc5732 to 38bee3f Compare April 9, 2025 11:51
@ev-br ev-br force-pushed the ilp64_accelerate branch from 316054d to 32133c7 Compare April 9, 2025 12:49
@ev-br ev-br force-pushed the ilp64_accelerate branch from 32133c7 to 3b09c48 Compare April 9, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.