-
-
Save marsprobe/b7fe1e85e6b15b9da2df1eb226edcfb4 to your computer and use it in GitHub Desktop.
Revisions
-
jorgemf revised this gist
Oct 7, 2017 . No changes.There are no files selected for viewing
-
jorgemf revised this gist
Oct 7, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -106,14 +106,14 @@ sed -i '\@https://github.com/google/protobuf/archive/0b059a3d8a8f8aa40dde7bea55e cd .. bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k --jobs 6 --verbose_failures //tensorflow_serving/model_servers:tensorflow_model_server # build fails, apply eigen patch wget -O /tmp/eigen.f3a22f35b044.cuda9.diff https://storage.googleapis.com/tf-performance/public/cuda9rc_patch/eigen.f3a22f35b044.cuda9.diff cd -P bazel-out/../../../external/eigen_archive patch -p1 < /tmp/eigen.f3a22f35b044.cuda9.diff cd - wget -O /tmp/eigen.f3a22f35b044.cuda9.diff https://storage.googleapis.com/tf-performance/public/cuda9rc_patch/eigen.f3a22f35b044.cuda9.diff # build again bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k --jobs 6 --verbose_failures //tensorflow_serving/model_servers:tensorflow_model_server cd $INITIAL_PATH -
jorgemf revised this gist
Oct 7, 2017 . 1 changed file with 22 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,8 @@ #!/bin/bash TENSORFLOW_COMMIT=9e76bf324f6bac63137a02bb6e6ec9120703ea9b # August 16, 2017 TENSORFLOW_SERVING_COMMIT=267d682bf43df1c8e87332d3712c411baf162fe9 # August 18, 2017 MODELS_COMMIT=78007443138108abf5170b296b4d703b49454487 # July 25, 2017 if [ -z $TENSORFLOW_SERVING_REPO_PATH ]; then TENSORFLOW_SERVING_REPO_PATH="serving" @@ -17,9 +16,10 @@ export TF_NEED_OPENCL=0 export TF_NEED_MKL=0 export TF_NEED_VERBS=0 export TF_NEED_MPI=0 export TF_NEED_GDR=0 export TF_ENABLE_XLA=0 export TF_CUDA_VERSION=8.0 export TF_CUDNN_VERSION=7 export TF_CUDA_CLANG=0 export TF_CUDA_COMPUTE_CAPABILITIES="3.5,5.2,6.1" CUDA_PATH="/usr/local/cuda" @@ -68,6 +68,7 @@ END export PYTHON_LIB_PATH=$(python_path) cd $TENSORFLOW_SERVING_REPO_PATH cd tensorflow git reset --hard @@ -87,6 +88,8 @@ cd ../tensorflow git submodule update --init --recursive git checkout $TENSORFLOW_COMMIT git submodule update --init --recursive wget -O /tmp/0002-TF-1.3-CUDA-9.0-and-cuDNN-7.0-support.patch https://github.com/tensorflow/tensorflow/files/1253794/0002-TF-1.3-CUDA-9.0-and-cuDNN-7.0-support.patch.txt git apply /tmp/0002-TF-1.3-CUDA-9.0-and-cuDNN-7.0-support.patch ./configure cd .. @@ -95,11 +98,22 @@ if [ -e $(which gcc-5) ]; then sed -i.bak 's/"gcc"/"gcc-5"/g' tensorflow/third_party/gpus/cuda_configure.bzl fi ## Error fix. Ref: https://github.com/tensorflow/serving/issues/327 sed -i.bak 's/external\/nccl_archive\///g' tensorflow/tensorflow/contrib/nccl/kernels/nccl_manager.h sed -i.bak 's/external\/nccl_archive\///g' tensorflow/tensorflow/contrib/nccl/kernels/nccl_ops.cc ## Error fix. Ref: https://github.com/tensorflow/tensorflow/issues/12979 sed -i '\@https://github.com/google/protobuf/archive/0b059a3d8a8f8aa40dde7bea55edca4ec5dfea66.tar.gz@d' tensorflow/tensorflow/workspace.bzl cd .. bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k --jobs 6 --verbose_failures @tf_serving//tensorflow_serving/model_servers:tensorflow_model_server # build fails, apply eigen patch wget -O /tmp/eigen.f3a22f35b044.cuda9.diff https://storage.googleapis.com/tf-performance/public/cuda9rc_patch/eigen.f3a22f35b044.cuda9.diff cd -P bazel-out/../../../external/eigen_archive patch -p1 < /tmp/eigen.f3a22f35b044.cuda9.diff cd - wget -O /tmp/eigen.f3a22f35b044.cuda9.diff https://storage.googleapis.com/tf-performance/public/cuda9rc_patch/eigen.f3a22f35b044.cuda9.diff # build again bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k --jobs 6 --verbose_failures @tf_serving//tensorflow_serving/model_servers:tensorflow_model_server cd $INITIAL_PATH -
jorgemf revised this gist
Jul 17, 2017 . No changes.There are no files selected for viewing
-
jorgemf revised this gist
Jul 17, 2017 . 1 changed file with 36 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,29 @@ #!/bin/bash TENSORFLOW_COMMIT=bef67104a0da34b6cac0d801168f2e42a1ab7921 # July 7, 2017 TENSORFLOW_SERVING_COMMIT=15cb2ace25493161d47b0d76047b3997d371e59c # July 14, 2017 MODELS_COMMIT=3d97b007cdb2c73f23daf9141437796095436c22 # July 7, 2017 if [ -z $TENSORFLOW_SERVING_REPO_PATH ]; then TENSORFLOW_SERVING_REPO_PATH="serving" fi INITIAL_PATH=$(pwd) export TF_NEED_CUDA=1 export TF_NEED_GCP=1 export TF_NEED_JEMALLOC=1 export TF_NEED_HDFS=0 export TF_NEED_OPENCL=0 export TF_NEED_MKL=0 export TF_NEED_VERBS=0 export TF_NEED_MPI=0 export TF_ENABLE_XLA=0 export TF_CUDA_VERSION=8.0 export TF_CUDNN_VERSION=5 export TF_CUDA_CLANG=0 export TF_CUDA_COMPUTE_CAPABILITIES="3.5,5.2,6.1" CUDA_PATH="/usr/local/cuda" if [ ! -d $CUDA_PATH ]; then CUDA_PATH="/opt/cuda" fi export CUDA_TOOLKIT_PATH=$CUDA_PATH @@ -61,14 +70,36 @@ export PYTHON_LIB_PATH=$(python_path) cd $TENSORFLOW_SERVING_REPO_PATH cd tensorflow git reset --hard git fetch cd ../tf_models git reset --hard git fetch cd .. git reset --hard git fetch git submodule update --init --recursive git checkout $TENSORFLOW_SERVING_COMMIT git submodule update --init --recursive cd tf_models git checkout $MODELS_COMMIT cd ../tensorflow git submodule update --init --recursive git checkout $TENSORFLOW_COMMIT git submodule update --init --recursive ./configure cd .. # force to use gcc-5 to compile CUDA if [ -e $(which gcc-5) ]; then sed -i.bak 's/"gcc"/"gcc-5"/g' tensorflow/third_party/gpus/cuda_configure.bzl fi # Error fix. Ref: https://github.com/tensorflow/serving/issues/327 sed -i.bak 's/external\/nccl_archive\///g' tensorflow/tensorflow/contrib/nccl/kernels/nccl_manager.h sed -i.bak 's/external\/nccl_archive\///g' tensorflow/tensorflow/contrib/nccl/kernels/nccl_ops.cc cd .. bazel build -c opt --config=cuda --verbose_failures @tf_serving//tensorflow_serving/model_servers:tensorflow_model_server cd $INITIAL_PATH -
jorgemf created this gist
Mar 1, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,74 @@ #!/bin/bash if [ -z $TENSORFLOW_SERVING_REPO_PATH ]; then TENSORFLOW_SERVING_REPO_PATH="tf-data-processor/tf_serving" fi INITIAL_PATH=$(pwd) export TF_NEED_CUDA=1 export TF_NEED_GCP=1 export TF_NEED_JEMALLOC=1 export TF_NEED_HDFS=0 export TF_NEED_OPENCL=0 export TF_ENABLE_XLA=0 export TF_CUDA_VERSION=8.0 export TF_CUDNN_VERSION=5 export TF_CUDA_COMPUTE_CAPABILITIES="3.5,5.2,6.1" CUDA_PATH="/usr/local/cuda" if ! [ -d CUDA_PATH ]; then CUDA_PATH="/opt/cuda" fi export CUDA_TOOLKIT_PATH=$CUDA_PATH export CUDNN_INSTALL_PATH=$CUDA_PATH export GCC_HOST_COMPILER_PATH=$(which gcc-5 || which gcc) export PYTHON_BIN_PATH=$(which python) export CC_OPT_FLAGS="-march=native" function python_path { "$PYTHON_BIN_PATH" - <<END from __future__ import print_function import site import os try: input = raw_input except NameError: pass python_paths = [] if os.getenv('PYTHONPATH') is not None: python_paths = os.getenv('PYTHONPATH').split(':') try: library_paths = site.getsitepackages() except AttributeError: from distutils.sysconfig import get_python_lib library_paths = [get_python_lib()] all_paths = set(python_paths + library_paths) paths = [] for path in all_paths: if os.path.isdir(path): paths.append(path) if len(paths) == 1: print(paths[0]) else: ret_paths = ",".join(paths) print(ret_paths) END } export PYTHON_LIB_PATH=$(python_path) cd $TENSORFLOW_SERVING_REPO_PATH cd tensorflow ./configure cd .. sed -i.bak 's/@org_tensorflow\/\/third_party\/gpus\/crosstool/@local_config_cuda\/\/crosstool:toolchain/g' tools/bazel.rc if [ -e $(which gcc-5) ]; then sed -i.bak 's/"gcc"/"gcc-5"/g' tensorflow/third_party/gpus/cuda_configure.bzl fi bazel build -c opt --config=cuda --spawn_strategy=standalone //tensorflow_serving/model_servers:tensorflow_model_server cd $INITIAL_PATH