Switching to atlas

I was running some numpy code that uses blas under the hood. I realised that I had not installed an optimised version of blas so I started digging around.

My system is Antargos (Arch variant), and I had installed python-numpy which is the python3 version of numpy from the Arch official repos. I ran a test in ipython:

In [1]: import numpy as np

In [2]: %timeit np.dot(np.random.random((2000,2000)),np.random.random((2000,2000)))
1 loops, best of 3: 10.8 s per loop

Then I installed the atlas-lapack-base package, restarted Ipython and ran the same test:

In [2]: %timeit np.dot(np.random.random((2000,2000)),np.random.random((2000,2000)))
1 loops, best of 3: 2.66 s per loop

Very satisfying without any effort!

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s