Lucas Araújo
Lucas Araújo

Reputation: 429

How to use intel python on docker?

My objective is to use Intel Python to accelerate some NumPy process, mainly the FFT function. But when I use Intel Python inside a docker it has the same efficiency that "normal" Python. How do I solve it?

Some useful information, to test the efficiency of those python I used this simple script:

import numpy as np

A = np.random.rand(5000,5000)
B = np.dot(A, A)

The results:

Using a Python 2.7 outside the docker:

time python bench.py 

real    0m5,207s
user    0m16,714s
sys     0m0,960s

Using the Intel Python outside the docker (using environment as the installation shows at this link):

time python bench.py 

real    0m3,744s
user    0m6,269s
sys     0m0,184s

The difference is clear, but when I do the same test but with dockers environment the same test shows same time.

Using a Python 2.7 inside the docker:

time python bench.py 

real    0m5.686s
user    0m18.060s
sys     0m1.045s

time python bench.py 

real    0m4.871s
user    0m16.641s
sys     0m1.134s

time python bench.py 

real    0m4.681s
user    0m16.805s
sys     0m0.635s

time python bench.py 

real    0m4.804s
user    0m17.058s
sys     0m0.706s

time python bench.py 

real    0m4.710s
user    0m17.057s
sys     0m0.607s

A result really close to the result outside docker.

Using the Intel Python inside the docker:

time python bench.py 

real    0m7.394s
user    0m18.744s
sys     0m1.931s

time python bench.py 

real    0m4.705s
user    0m16.449s
sys     0m0.786s

time python bench.py 

real    0m4.721s
user    0m16.495s
sys     0m0.809s

time python bench.py 

real    0m4.735s
user    0m16.929s
sys     0m0.694s

Why the both pythons has the same efficiency inside the docker? I'm doing something wrong? My test is invalid for some reason?

And I'm pretty sure that I'm using Intel Python inside the docker, because when just use the command python on bash inside the docker this is the output:

Python 2.7.14 |Intel Corporation| (default, Aug  3 2018, 14:28:40) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux2

On the other docker the return is:

Python 2.7.9 (default, Sep 25 2018, 20:42:16) 
[GCC 4.9.2] on linux2

Upvotes: 0

Views: 218

Answers (0)

Related Questions