Skip to content

Element-wise multiplication of BCOO sparse matrices reports out of memory error #15070

Closed Answered by jakevdp
shirakawatoru asked this question in Q&A
Discussion options

You must be logged in to vote

Hi - thanks for the question. You're right that in theory this should be possible: the problem is that jax.experimental.sparse is built on the operations available in XLA, and XLA doesn't have any set-like methods which are required for many sparse-sparse operations. So jax.experimental.sparse relies on a very inefficient method to compute sparse-sparse elementwise multiplication. I don't know of any workaround aside from using smaller matrices or a larger machine, or perhaps converting your matrices to a more structured sparse form (incidentally, issues like this are one reason JAX's sparse support is still experimental: it works well in many cases, but for sparse-sparse operations in pa…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shirakawatoru
Comment options

Answer selected by shirakawatoru
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants