[Numpy-discussion] Performance issue in covariance function in Numpy 1.9 and later

Ecem sogancıoglu ecemsogancioglu at gmail.com
Fri Jul 22 11:09:28 EDT 2016


Hi Ralf,

Thank you so much for your answer.

I finally figured out that the problem was because Numpy 1.9 was not linked
to BLAS. I do not know why because I simply installed numpy 1.9 via the
commands:

apt-get install python3-numpy

If anybody has the same problem, you may want to take a look into this:
http://osdf.github.io/blog/numpyscipy-with-openblas-for-ubuntu-1204-second-try.html

Best Regards,
Ecem

On Fri, Jul 22, 2016 at 5:19 PM Ecem sogancıoglu <ecemsogancioglu at gmail.com>
wrote:

> Dear Ralf,
>
> Thank you so much for your answer.
>
> I finally figured out that the problem was because Numpy 1.9 was not
> linked to BLAS. I do not know why because I simply installed numpy 1.9 via
> the commands:
>
> apt-get install python3-numpy
>
> If anybody has the same problem, you may want to take a look into this:
> http://osdf.github.io/blog/numpyscipy-with-openblas-for-ubuntu-1204-second-try.html
>
> Best Regards,
> Ecem
>
>
>
>
> On Tue, Jul 19, 2016 at 9:44 PM Ralf Gommers <ralf.gommers at gmail.com>
> wrote:
>
>> On Tue, Jul 19, 2016 at 3:53 PM, Ecem sogancıoglu <
>> ecemsogancioglu at gmail.com> wrote:
>>
>>> Hello All,
>>>
>>> there seems to be a performance issue with the covariance function in
>>> numpy 1.9 and later.
>>>
>>> Code example:
>>> *np.cov(np.random.randn(700,37000))*
>>>
>>> In numpy 1.8, this line of code requires 4.5755 seconds.
>>> In numpy 1.9 and later, the same line of code requires more than 30.3709
>>> s execution time.
>>>
>>
>> Hi Ecem, can you make sure to use the exact same random array as input to
>> np.cov when testing this? Also timing just the function call you're
>> interested in would be good; the creating of your 2-D array takes longer
>> than the np.cov call:
>>
>> In [5]: np.random.seed(1234)
>>
>> In [6]: x = np.random.randn(700,37000)
>>
>> In [7]: %timeit np.cov(x)
>> 1 loops, best of 3: 572 ms per loop
>>
>> In [8]: %timeit np.random.randn(700, 37000)
>> 1 loops, best of 3: 1.26 s per loop
>>
>>
>> Cheers,
>> Ralf
>>
>>
>>
>>> Has anyone else observed this problem and is there a known bugfix?
>>>
>>>
>>> _______________________________________________
>>> NumPy-Discussion mailing list
>>> NumPy-Discussion at scipy.org
>>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>>
>>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at scipy.org
>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20160722/f6425886/attachment.html>


More information about the NumPy-Discussion mailing list