Unsorted Notes

Numpy with MKL acceleration on Lindgren

A quick test what performance could be expected from Python code in scientific computing.

I was curious what difference could make the use of MKL in numerical calculations with Python. A few benchmark programs that have been executed with the Python distribution Canopy gave a first impression. I run them on Lindgren, our Cray XE6 system with AMD Opteron 6172 processors. The processors' clock frequency is 2.1 GHz, per node are 2 processors (24 cores) available. The benchmarks run as they have been executed by the scheduler, i.e. no further tunings like the definition of assignments of threads to cores have been used.

DGEMM Benchmark

The DGEMM benchmark evaluates the numpy operation dot on an array:

# Preparation
A = numpy.asarray(numpy.random.rand(N, N))
B = numpy.asarray(numpy.random.rand(N, N))

# Benchmark operation
C = A.dot(B)

Results:

Cholesky Decomposition Benchmark

The Cholesky benchmark evaluates one of numpy's linear algebra operations:

# Preparation
A = numpy.asarray(numpy.random.rand(N, N))
A = A*A.transpose() + N*numpy.eye(N)

# Benchmark operation
L = numpy.linalg.cholesky(A)

Results:

Numexpr Benchmark

The Numexpr benchmark evaluates the application of a numerical expression to its operands given in two arrays and measures the achieved memory bandwidth:

# Preparation
x = numpy.asarray(np.linspace(-1, 1, N))
y = numpy.asarray(np.linspace(-1, 1, N))
z = numpy.empty_like(x)

# Benchmark operation
numexpr.evaluate('2*y+4*x', out = z)

Results:


2013-12-29 – Category: programming – Tags: mkl numpy python