|
| 1 | +# Steps to generate a container with Intel® Optimization for TensorFlow |
| 2 | + |
| 3 | +This guide will help you generate a container with Intel's r2.3 branch. |
| 4 | + |
| 5 | +## Steps: |
| 6 | + |
| 7 | +1. Clone intel-tensorflow r2.4.0 branch: |
| 8 | + |
| 9 | + ``` |
| 10 | + $ git clone https://github.com/Intel-tensorflow/tensorflow.git --branch=r2.4.0 --single-branch |
| 11 | + $ cd tensorflow |
| 12 | + $ git checkout v2.4.0 |
| 13 | + # Run "git log" and check for the right git hash |
| 14 | + ``` |
| 15 | +
|
| 16 | +2. Go to the directory that has Intel mkl docker files: |
| 17 | +
|
| 18 | + ``` |
| 19 | + $ cd tensorflow/tools/ci_build/linux/mkl/ |
| 20 | + ``` |
| 21 | +
|
| 22 | +3. Run build-dev-container.sh by passing the following env parameters: |
| 23 | +
|
| 24 | + For AVX containers: |
| 25 | +
|
| 26 | + ``` |
| 27 | + $ env ROOT_CONTAINER=tensorflow/tensorflow \ |
| 28 | + ROOT_CONTAINER_TAG=devel \ |
| 29 | + TF_DOCKER_BUILD_DEVEL_BRANCH=v2.4.0 \ |
| 30 | + TF_REPO=https://github.com/Intel-tensorflow/tensorflow \ |
| 31 | + TF_DOCKER_BUILD_VERSION=2.4.0 \ |
| 32 | + BUILD_AVX_CONTAINERS=yes \ |
| 33 | + BUILD_TF_V2_CONTAINERS=yes \ |
| 34 | + BAZEL_VERSION=3.1.0 \ |
| 35 | + ENABLE_SECURE_BUILD=yes \ |
| 36 | + ENABLE_HOROVOD=yes \ |
| 37 | + ./build-dev-container.sh > ./container_build.log |
| 38 | + ``` |
| 39 | +
|
| 40 | + For AVX512 containers: |
| 41 | +
|
| 42 | + ``` |
| 43 | + $ env ROOT_CONTAINER=tensorflow/tensorflow \ |
| 44 | + ROOT_CONTAINER_TAG=devel \ |
| 45 | + TF_DOCKER_BUILD_DEVEL_BRANCH=v2.4.0 \ |
| 46 | + TF_REPO=https://github.com/Intel-tensorflow/tensorflow \ |
| 47 | + TF_DOCKER_BUILD_VERSION=2.4.0 \ |
| 48 | + BUILD_SKX_CONTAINERS=yes \ |
| 49 | + BUILD_TF_V2_CONTAINERS=yes \ |
| 50 | + BAZEL_VERSION=3.1.0 \ |
| 51 | + ENABLE_SECURE_BUILD=yes \ |
| 52 | + ENABLE_HOROVOD=yes \ |
| 53 | + ./build-dev-container.sh > ./container_build.log |
| 54 | + ``` |
| 55 | +
|
| 56 | +4. Open a second terminal session at the same location and run `tail -f container_build.log` to monitor container build progress |
| 57 | + or wait until the build finishes and then open the log file <container_build.log> ... |
| 58 | +
|
| 59 | + ``` |
| 60 | + INFO: Build completed successfully, 18811 total actions. |
| 61 | + ``` |
| 62 | +
|
| 63 | + Below output indicates that the container has intel-optimized tensorflow: |
| 64 | +
|
| 65 | + ``` |
| 66 | + PASS: MKL enabled test in <intermediate container name> |
| 67 | + ``` |
| 68 | +
|
| 69 | +5. Check if the image was built successfully and tag it: |
| 70 | +
|
| 71 | + AVX container: |
| 72 | +
|
| 73 | + ``` |
| 74 | + $ docker images |
| 75 | + intel-mkl/tensorflow:2.4.0-devel-mkl |
| 76 | + $ docker tag intel-mkl/tensorflow:2.4.0-devel-mkl intel/intel-optimized-tensorflow:2.4.0-devel-mkl |
| 77 | + ``` |
| 78 | +
|
| 79 | + AVX512 container: |
| 80 | +
|
| 81 | + ``` |
| 82 | + $ docker images |
| 83 | + intel-mkl/tensorflow:2.4.0-avx512-devel-mkl |
| 84 | + |
| 85 | + $ docker tag intel-mkl/tensorflow:2.4.0-avx512-devel-mkl intel/intel-optimized-tensorflow:2.4.0-avx512-devel-mkl |
| 86 | + ``` |
| 87 | +
|
| 88 | +
|
| 89 | +
|
0 commit comments