message: Adding support for MKL builds with AVX2. MKL-DNN ignores the compiler switches and takes code paths based on the platform detected at runtime. This commit will add support for avx2 instructions to the rest of TensorFlow.
diff: @@ -34,6 +34,9 @@ echo "TF_DOCKER_BUILD_DEVEL_BRANCH=${TF_DOCKER_BUILD_DEVEL_BRANCH}"
  echo "TF_DOCKER_BUILD_IMAGE_NAME=${TF_DOCKER_BUILD_IMAGE_NAME}"
  echo "TF_DOCKER_BUILD_VERSION=${TF_DOCKER_BUILD_VERSION}"
  +# Build containers for AVX
  +#"TF_BAZEL_BUILD_OPTIONS": "'{}'" (default build option= avx)
  +
  # build the python 2 container and whl
  TF_DOCKER_BUILD_TYPE="MKL" \
  TF_DOCKER_BUILD_IS_DEVEL="YES" \
  @@ -51,3 +54,25 @@ TF_DOCKER_BUILD_TYPE="MKL" \
  TF_DOCKER_BUILD_PYTHON_VERSION="PYTHON3" \
  ${WORKSPACE}/tensorflow/tools/docker/parameterized_docker_build.sh
  +# Build containers for AVX2
  +TF_BAZEL_BUILD_OPTIONS="--config=mkl --copt=-mavx2 --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0"
  +
  +# build the python 2 container and whl
  +TF_DOCKER_BUILD_TYPE="MKL" \
  + TF_DOCKER_BUILD_IS_DEVEL="YES" \
  + TF_DOCKER_BUILD_DEVEL_BRANCH="${TF_DOCKER_BUILD_DEVEL_BRANCH}" \
  + TF_DOCKER_BUILD_IMAGE_NAME="${TF_DOCKER_BUILD_IMAGE_NAME}" \
  + TF_DOCKER_BUILD_VERSION="${TF_DOCKER_BUILD_VERSION}-avx2" \
  + TF_BAZEL_BUILD_OPTIONS="${TF_BAZEL_BUILD_OPTIONS}" \
  + ${WORKSPACE}/tensorflow/tools/docker/parameterized_docker_build.sh
  +
  +# build the python 3 container and whl
  +TF_DOCKER_BUILD_TYPE="MKL" \
  + TF_DOCKER_BUILD_IS_DEVEL="YES" \
  + TF_DOCKER_BUILD_DEVEL_BRANCH="${TF_DOCKER_BUILD_DEVEL_BRANCH}" \
  + TF_DOCKER_BUILD_IMAGE_NAME="${TF_DOCKER_BUILD_IMAGE_NAME}" \
  + TF_DOCKER_BUILD_VERSION="${TF_DOCKER_BUILD_VERSION}-avx2" \
  + TF_DOCKER_BUILD_PYTHON_VERSION="PYTHON3" \
  + TF_BAZEL_BUILD_OPTIONS="${TF_BAZEL_BUILD_OPTIONS}" \
  + ${WORKSPACE}/tensorflow/tools/docker/parameterized_docker_build.sh
  +
  