pydata / sparse

Sparse multi-dimensional arrays for the PyData ecosystem

Home Page:https://sparse.pydata.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Faster sum over axis

liuzhenqi77 opened this issue · comments

Description
Hi, currently I'm facing a performance issue where I need to sum over the first axis of a float64 coo matrix with shape like (14371, 91, 109, 91) and density around 0.01. I'm doing it with the native coo_matrix.sum(axis=0). I was wondering is there any way to optimize this for better speed?

Numba does not work in this case (No implementation found for signature sum(COOType[float64, int64, 4], axis=Literal[int](0))). I'm also not sure how to apply the custom solutions online on the sparse.coo type.

Thanks!

Well, unfortunately there isn't a faster way currently.