Docker images with architecture optimizations?

Some libraries like BLAS / LAPACK or some optimization libraries are optimized for the local machine architecture at compile time. Let's take OpenBlas as an example. There are two ways to create a Docker container with OpenBlas:

  • Use a Dockerfile where you point to the git clone of the OpenBlas library along with all the necessary compilation flags and build commands.

  • Pull and run another Ubuntu + OpenBlas user image from the Docker Hub.

Option (1) ensures that OpenBlas is built and optimized for your machine. How about option (2)? As a Docker newbie, I can see that the images are somehow fixed and static, so running this image will not be optimized for my machine (which could be AMD based instead of Intel developer processor). What confused me is that the ipython / scipyserver image makes it clone the latest OpenBlas master from Github at build time.

I seem to be misunderstanding the concept of Docker images and / or automated builds and I am very grateful for the clarification.

+3


source to share


1 answer


No, I think you're okay.

The image you are linking to is an automatic build, so OpenBlas will be compiled using the Docker build server kernel and architecture. I noticed that the build script sets the following flags when building OpenBlas:



DYNAMIC_ARCH=1 NO_AFFINITY=1 NUM_THREADS=32

      

Which, presumably, does the installation move at the strike price. An alternative would be to have a separate image for different build configurations.

+1


source







All Articles