2

I've been trying to install Numpy/Scipy and allow them to both use Openblas. I've been following various guides but have been using this one of late. At the end of the guide, there are a couple of tests to check the speed up of Numpy/Scipy. The tests are:

import numpy
import sys
import timeit

try:
    import numpy.core._dotblas
    print 'FAST BLAS'
except ImportError:
    print 'slow blas'

print "version:", numpy.__version__
print "maxint:", sys.maxint
print

x = numpy.random.random((1000,1000))

setup = "import numpy; x = numpy.random.random((1000,1000))"
count = 5

t = timeit.Timer("numpy.dot(x, x.T)", setup=setup)
print "dot:", t.timeit(count)/count, "sec"


import timeit

setup = "import numpy;\
        import scipy.linalg as linalg;\
        x = numpy.random.random((1000,1000));\
        z = numpy.dot(x, x.T)"
count = 5

t = timeit.Timer("linalg.cholesky(z, lower=True)", setup=setup)
print "cholesky:", t.timeit(count)/count, "sec"

t = timeit.Timer("linalg.svd(z)", setup=setup)
print "svd:", t.timeit(count)/count, "sec"

My test results show that slow blas is being used. However my test results are in line with the guide's test results. My feeling is that openblas is being used by both Numpy/Scipy but slow blas is being printed because numpy.core doesn't have the _dotblas file (which it doesn't). How I can further tell whether openblas is actually being used?

Guide's test results:

NumPy
dot: 0.0569217920303 sec

SciPy
cholesky: 0.0204758167267 sec
svd: 0.81153883934 sec

My test results:

slow blas
version: 1.10.0.dev0+a419ebb
maxint: 9223372036854775807

dot: 0.0185512065887 sec
cholesky: 0.0125649929047 sec
svd: 0.293599033356 sec
0

0

You must log in to answer this question.

Browse other questions tagged .