Support for batched `cupyx.scipy.sparse.linalg.spsolve`
See original GitHub issueDescription
Currently, cupy.linalg.solve
supports batch processing. Such functionality for cupyx.scipy.sparse.linalg.spsolve
would be a great asset and would prevent slow, manual loops.
For example:
N
being the batch dimension
A x = b
, with
-
A: Sparse matrix with dimension
(N, M, M)
or as list withN
-Sparse matrices(M, M)
. -
b: Dense matrix with dimension
(N, M)
or as list withN
-Dense vectors(M)
. -
x: Dense matrix with dimension
(N, M)
or as list withN
-Dense vectors(M)
.
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
cupyx.scipy.sparse.linalg.spsolve — CuPy 11.4.0 documentation
cupyx.scipy.sparse.linalg.spsolve(A, b)[source]#. Solves a sparse linear system A x = b. Parameters. A (cupyx.scipy.sparse.spmatrix) – Sparse matrix with ...
Read more >scipy.sparse.linalg.spsolve — SciPy v1.9.3 Manual
Solve the sparse linear system Ax=b, where b may be a vector or a matrix. Parameters. Andarray or sparse matrix. The square matrix...
Read more >CuPy Documentation - Read the Docs
Supports the semantics identical to numpy.ndarray, including basic / advanced indexing and broadcasting. • Sparse matrices: cupyx.scipy.
Read more >cupy-cuda102: Versions - Openbase
Fix 1-dim lexsort (#7191); Fix cupyx.scipy.ndimage.zoom for outputs of size ... RHS in cupyx.scipy.sparse.linalg.spsolve (#5180); Fix poisson to support lam ...
Read more >Scipy sparse invert or spsolve lead to ... - Stack Overflow
ones(N) ) as you question falsely assumes. The point here is that matrix inverses are seldom useful in numerical linear algebra: the solution...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In the meantime, I found another solution to enable “batched” spsolve. I combined all my A input matrices into one global matrix and reshaped the b vectors into one vector. After that, instead of many systems of equations, you can solve just the one. Then the output vector x can be reshaped into the desired batched shape. The basic idea came from this post.
@kmaehashi @emcastillo can we reopen this for now? batched
spsolve
is one of the most frequent asks I’ve run into and it’d be nice to discuss further.