Reputation: 97
I got some speedup on my code when I linked my numpy to MKL. It's still not fast enough so we are considering using cython. The approach I have in mind is to use CythonGSL to perform the expensive functions in cython using gsl's blas functions. However there's a chance this is a waste of time because numpy is already making MKL do some of its work.
However I don't know how much and exactly what is being done by MKL. The expensive bits of my code are np.sums and np.dots. I suspect by linking MKL the code is already the most optimized it can be, but I'm not sure. So can someone that knows about what numpy + MKL's behavior tell me if I'm probably wasting my time by doing a cython implementation?
Upvotes: 1
Views: 197
Reputation: 3477
Don't do it! There is 0 gains to be made by going to GSL with BLAS operations. It is just linked to some other implementation depending on how you built it. What des the code look like and why do you think that it is slow? Hav ea look here in the meantime.
Benchmarking (python vs. c++ using BLAS) and (numpy)
People have all sorts of assumptions that they make, why things are fast/slow. It usually becomes obvious, where the problem is, when you see code and realize that they might do unnecessary copying of matrices etc.
Upvotes: 1