Idea: support virtual table of LAPACK functions
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start by reviewing the proposed lax::init_from_python(py) entry point, SciPy's scipy.linalg.cython_blas and scipy.linalg.cython_lapack interfaces, and the working approach linked in lenskit/lkpy#960. Define how a PyO3 module would obtain and install the function pointers so lax and ndarray-linalg can reuse SciPy's BLAS and LAPACK without a separate copy.
Written by the indexing model from the issue text.
Description
This might more properly belong in lapack-sys, but it would be very useful to be able to reuse BLAS and LAPACK from SciPy when using lax and ndarray-linalg to build Python extension modules with PyO3.
SciPy exposes routines from the BLAS and LAPACK it was linked against in a manner that can be imported with Cython's cimport, in the modules scipy.linalg.cython_blas and scipy.linalg.cython_lapack, to allow other Python extension modules implemented using Cython to reuse BLAS and LAPACK instead of needing to supply their own copy. I am not sure the best way to identify and properly link against these functions; I have one working method at lenskit/lkpy#960, fishing a pointer to sposv out of Python at runtime (the Cython modules expose them in a Python dictionary).
I imagine an interface where a PyO3 extension module can do something like use lax with a python feature, then call a method like lax::init_from_python(py) in a module initializer to grab the proper function pointers and set them up for lax to use, after which the lax methods (and therefore ndarray-linalg) will work without needing to compile or link against a separate BLAS and LAPACK.
In shared-library settings, like Pixi/Conda or system packages, all of the different modules can directly link against the same "system" BLAS. However, Python binary wheels do not make that easy, and the general solution is for each package to statically link against BLAS, or to use SciPy's export if it depends on SciPy.
- Dominant language
- Rust
- Stars
- 452
- Forks
- 95
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-ndarray/ndarray-linalg
-
Thin SVD Open
Difficulty 5/5 Over a week Newbie friendliness 38/100
rust-ndarray/ndarray-linalg#414 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
rust-ndarray/ndarray-linalg#404 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-ndarray/ndarray-linalg#402 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-ndarray/ndarray-linalg#401 · 2 reactions ·
-
Add RQ decomposition Open
Difficulty 5/5 Over a week Newbie friendliness 35/100
rust-ndarray/ndarray-linalg#398 ·
All issues in rust-ndarray/ndarray-linalg
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100