Skip to content

Commit 4472438

Browse files
authored
Merge pull request #1819 from ashahba/ashahba/r2.4-fix-mkl-build
[INTEL MKL] Fix TensorFlow serving build issue for MKL dockerfiles
2 parents 233bf24 + 4246080 commit 4472438

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build:cuda --action_env=TF_CUDA_COMPUTE_CAPABILITIES="sm_35,sm_50,sm_60,sm_70,sm
1111
# Please note that MKL on MacOS or windows is still not supported.
1212
# If you would like to use a local MKL instead of downloading, please set the
1313
# environment variable "TF_MKL_ROOT" every time before build.
14-
build:mkl --define=build_with_mkl=true --define=enable_mkl=true
14+
build:mkl --define=build_with_mkl=true --define=enable_mkl=true --define=build_with_openmp=true
1515
build:mkl --define=tensorflow_mkldnn_contraction_kernel=0
1616

1717
# This config option is used to enable MKL-DNN open source library only,

tensorflow_serving/tools/docker/Dockerfile.devel-mkl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ FROM ubuntu:18.04 as base_build
1616
ARG TF_SERVING_VERSION_GIT_BRANCH=master
1717
ARG TF_SERVING_VERSION_GIT_COMMIT=HEAD
1818

19-
LABEL maintainer="Clayne Robison <clayne.b.robison@intel.com>"
19+
LABEL maintainer="Abolfazl Shahbazi <abolfazl.shahbazi@intel.com>"
2020
LABEL tensorflow_serving_github_branchtag=${TF_SERVING_VERSION_GIT_BRANCH}
2121
LABEL tensorflow_serving_github_commit=${TF_SERVING_VERSION_GIT_COMMIT}
2222

@@ -93,6 +93,7 @@ RUN curl -sSL --retry 5 https://github.com/tensorflow/serving/tarball/${TF_SERVI
9393
FROM base_build as binary_build
9494
# Build, and install TensorFlow Serving
9595
ARG TF_SERVING_BUILD_OPTIONS="--config=mkl --config=release"
96+
9697
RUN echo "Building with build options: ${TF_SERVING_BUILD_OPTIONS}"
9798
ARG TF_SERVING_BAZEL_OPTIONS=""
9899
RUN echo "Building with Bazel options: ${TF_SERVING_BAZEL_OPTIONS}"
@@ -119,8 +120,8 @@ RUN bazel build --color=yes --curses=yes \
119120
/tmp/pip/tensorflow_serving_api-*.whl && \
120121
rm -rf /tmp/pip
121122

122-
# Copy MKL libraries
123-
RUN cp /root/.cache/bazel/_bazel_root/*/external/mkl_linux/lib/* /usr/local/lib
123+
# Copy openmp libraries
124+
RUN cp /root/.cache/bazel/_bazel_root/*/execroot/tf_serving/bazel-out/k8-opt/bin/external/llvm_openmp/libiomp5.so /usr/local/lib/
124125

125126
ENV LIBRARY_PATH '/usr/local/lib:$LIBRARY_PATH'
126127
ENV LD_LIBRARY_PATH '/usr/local/lib:$LD_LIBRARY_PATH'

tensorflow_serving/tools/docker/Dockerfile.mkl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ FROM ubuntu:18.04
2121
ARG TF_SERVING_VERSION_GIT_BRANCH=master
2222
ARG TF_SERVING_VERSION_GIT_COMMIT=head
2323

24-
LABEL maintainer="Clayne Robison <clayne.b.robison@intel.com>"
24+
LABEL maintainer="Abolfazl Shahbazi <abolfazl.shahbazi@intel.com>"
2525
LABEL tensorflow_serving_github_branchtag=${TF_SERVING_VERSION_GIT_BRANCH}
2626
LABEL tensorflow_serving_github_commit=${TF_SERVING_VERSION_GIT_COMMIT}
2727

@@ -36,8 +36,6 @@ COPY --from=build_image /usr/local/bin/tensorflow_model_server /usr/bin/tensorfl
3636

3737
# Install MKL libraries
3838
COPY --from=build_image /usr/local/lib/libiomp5.so /usr/local/lib
39-
COPY --from=build_image /usr/local/lib/libmklml_gnu.so /usr/local/lib
40-
COPY --from=build_image /usr/local/lib/libmklml_intel.so /usr/local/lib
4139

4240
ENV LIBRARY_PATH '/usr/local/lib:$LIBRARY_PATH'
4341
ENV LD_LIBRARY_PATH '/usr/local/lib:$LD_LIBRARY_PATH'

0 commit comments

Comments
 (0)