Parallel sparse matrix (CSR) operations?
[email protected] Mon, 04 Dec 2023 07:58:08 -0000
| Newsgroups | gmane.comp.python.scientific.devel |
|---|---|
| Message-ID | <[email protected]> |
Is there some appetite for parallelizing the basic sparse matrix operations? The existing CSR methods for matrix construction, multiply, matvec, binop, etc. are written in sequential C++ and offer some low-hanging fruit for parallelism. The main loop for most of these is (or can easily be made) embarrassingly parallel. As a proof of concept I converted the outer loops of many methods to parallel STL algorithms and saw a 3-5x speedup on my 6-core laptop (on medium/large versions of existing benchmarks). Operations on small matrices should remain sequential to avoid paying parallel overhead when it won't be amortized. The parallel STL algorithms I used are implemented with a thread pool. This avoids the TBB requirement for GCC's parallel STL and will work on all platforms. I avoided OpenMP as per docs. If there is a different preferred way to write parallel C++ in the SciPy codebase, let me know. If folks are interested I'd be happy to contribute a workable PR. The code is cleaner than I expected it to be. -Adam _______________________________________________ SciPy-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/scipy-dev.python.org/ Member address: [email protected]