rationalmatter / Juno-Issue-Tracker

Defect Tracker for Juno
76 stars 1 forks source link

Faster linear algebra back-end #275

Open jfincham opened 2 years ago

jfincham commented 2 years ago

Is your feature request related to a problem? Please describe. Linear algebra, e.g. np.linalg.solve is slow (iPad Pro 12.9 2020) compared to desktop or Android solutions.

Describe the solution you'd like From numpy.show_config() it looks like Juno isn’t using OpenBLAS or similar back-ends. Is it possible to improve this?

alexstaravoitau commented 2 years ago

Thank you for reporting @jfincham — had no idea these options existed! I will be upgrading NumPy soon, so will make sure to enable a faster backend. OpenBLAS should already be available in Juno from SciPy, but I think I may need to re-built NumPy to get it to use it.

Can you suggest a way to quickly benchmark NumPy installations, to make sure it indeed uses a faster backend?

jfincham commented 2 years ago

Thanks for looking into this. There are probably proper benchmarks I'm not aware of, but as a one-line speed check you could do np.linalg.solve(np.random.randn(5000, 5000), np.random.randn(5000, 1)) to solve a matrix of 5000 equations. This takes around 20-25 seconds on my iPad. I think I'd expect around 1/10th that if OpenBLAS is doing its thing?