Speeding up numpy.dot

后端 未结 4 1599
[愿得一人]
[愿得一人] 2021-02-04 10:49

I\'ve got a numpy script that spends about 50% of its runtime in the following code:

s = numpy.dot(v1, v1)

where

v1 = v[1

4条回答
  •  灰色年华
    2021-02-04 11:11

    numpy.dot will use multithreading if compiled correctly. Make sure that it does with top. I know of cases where people didn't get multithreading in numpy w/ atlas to work. Furthermore, it's worth trying to use a numpy version that is compiled against the intel mkl libraries. They include blas routines that are supposed to be faster than atlas on intel hardware. You could give enthought's python distro a try. Contains all this and is free for people with an edu email account.

提交回复
热议问题