Comments (9)
We have our own matmul routines now, so this should be fairly easy, just moving imports to where they're needed, dropping the dependency and adding it to the test requirements.
from sparse.
In most applications that I care about tensordot
is critical. I'm happy to depend on scipy separately though.
Of course, we could always make our own CSR :)
from sparse.
I'm not aware of how to do these things, so two questions come to mind:
CSR @ CSR
,CSR@Dense
,[svd|eig|solve](CSR)
is usually BLAS accelerated. We can and should use those. I know those can be wrapped with Cython.- How do we support multiple separate BLAS libraries? Is it even possible/easy?
I have zero experience here.
from sparse.
- BLAS generally doesn't have L3 operations for sparse matrices. I notice that scipy.sparse makes reference to Eigen, so perhaps they're linking to a sparse implementation there. In practice though I'm not sure how much advantage you'll get over linking to an optimized library rather than writing it yourself, at least for matvec/matmul. Solve/svd/eig could easily be more complex though and might warrant relying on some other code. I recommend looking at the scipy.sparse solution, and then hunting around on a search engine for appropriate libraries.
- If you do want to touch BLAS libraries then I recommend just using the Python linked functions in
scipy.linalg.blas
to start. These tend to link to a particular BLAS implementation. There is decent documentation online helping people to identify and change their linked implementation if desired.
from sparse.
scipy.linalg.blas
is great! It does exactly what I needed, without needing to link/compile BLAS myself!
from sparse.
SuiteSparse is generally considered to have state of the art implementations for sparse linear algebra, but it's GPL licensed so SciPy can't use it directly.
It looks like SciPy mostly uses SuperLU or ARPACK. For matmul, I agree with @mrocklin that you would probably do fine implementing it yourself with a fairly naive loop.
from sparse.
The eventual plan here was to get CSF into this library, and turn it into just a container, then start adding algorithms like this to SciPy instead. :-)
from sparse.
I notice that scipy.sparse makes reference to Eigen, so perhaps they're linking to a sparse implementation there.
Nope, that's not the case. No external library is used there. And Eigen isn't used anywhere in the numpy/scipy ecosystem as far as I'm aware.
scipy.linalg.blas is great! It does exactly what I needed, without needing to link/compile BLAS myself!
yep that's the way to go (or linalg.cython_blas
/ linalg.cython_lapack
if needed). you definitely don't want to link directly to any BLAS
SuiteSparse is generally considered to have state of the art implementations for sparse linear algebra, but it's GPL licensed so SciPy can't use it directly.
scikit-umfpack
does link to SuiteSparse, in case anyone needs that.
The eventual plan here was to get CSF into this library, and turn it into just a container, then start adding algorithms like this to SciPy instead. :-)
still +1 on that
from sparse.
This is a very old issue but I'll +1 it just for the signal boost. My use-case is that I'm trying to build a Docker image with minimal dependencies, and I was almost able to drop scipy
(which is pretty big) but sparse
pulled it back in.
from sparse.
Related Issues (20)
- Unable to install shap on python 3.11 doubt to numba cannot install on Python version 3.11.2 HOT 1
- `einsum` doesn't handle `dtype` and `optimize` kwargs HOT 2
- Proper usage of sparse 3D array: initialization, assignment of values and use in calculations HOT 2
- np.diff equivalent HOT 2
- DeprecationWarning: coords should be an ndarray. This will raise a ValueError in the future. HOT 1
- Test failures in test_tensordot HOT 14
- Correct type hint for sparse COO matrix? HOT 1
- numpy ufuncs can change the compression of a gcxs array HOT 12
- Support `arr.size >= 2 ** 64` as long as each dimension is `< 2 ** 64` HOT 1
- Constructing GCXS from non-canonical `scipy.sparse.csr_matrix` results in wrong results HOT 5
- Support for Fortran order in COO.flatten() HOT 1
- Consider MatRepr for `__repr__` and `_repr_html_` HOT 9
- `GCXS` matmul => slice leads to incorrect results HOT 4
- `TypeError` when accessing `.real` and `.imag` attribute on sparse array of string type
- Installing directly from GitHub fails on Python 3.12 HOT 5
- Some functions seem missing from the top level import HOT 2
- [conda] Sparse version string is not recognized by pip list/check HOT 1
- Segmentation fault on arm64 HOT 11
- Remove runtime dependency on SciPy HOT 1
- Xarray/Numpy/Dask Indexing using a Sparse Array HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sparse.