PyLops / pylops

PyLops – A Linear-Operator Library for Python
https://pylops.readthedocs.io
GNU Lesser General Public License v3.0
430 stars 102 forks source link

GPU support for sparse matrix? #539

Closed ChemEng227 closed 1 year ago

ChemEng227 commented 1 year ago

Recently I was doing some optimization tasks with linear operators at the size of about 40000*90000. These operators are sparse so I used scipy.sparse matrix to store them. However, On doing the optimization work the calculation time gets quite long and almost unacceptable, and multi-threading didn't make much better performance. I tried to use GPU boosting following the instructions on pylops document. I converted the matrix to cupy dense but it instantly drained my RAM and VRAM. Following to cupy documentations I found that it states that cupyx.sparse modules supports GPU boosting for sparse matrix calculations. However, current version of pylops doesn't seem to support cupyx.sparse matrix in pylops.MatrixMult(). Is there a way that I could use GPU boosting on sparse matrix multiplying? Or do I have to change to another potential wheel?

ChemEng227 commented 1 year ago

It was my fault. I forgot to convert my data to cupy array. Sorry for the disturbance.