Skip to content

Commit

Permalink
Fixes and backports for v1.12 from https://github.com/jackmitch/tenso…
Browse files Browse the repository at this point in the history
  • Loading branch information
lhelontra committed Dec 20, 2018
1 parent e14423f commit 2c34667
Show file tree
Hide file tree
Showing 11 changed files with 655 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build_tensorflow/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ WORKDIR /root
RUN git clone https://github.com/lhelontra/tensorflow-on-arm/

WORKDIR /root/tensorflow-on-arm/build_tensorflow/
RUN git checkout v1.11.0
RUN git checkout v1.12.0
CMD ["/bin/bash"]
5 changes: 4 additions & 1 deletion build_tensorflow/configs/beagle_black.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TF_PATCH="no"
TF_PATCH="yes"
TF_VERSION="v1.12.0"

# export tensorflow variables to configure
Expand All @@ -14,6 +14,8 @@ TF_BUILD_VARS+=" TF_NEED_MKL=0"
TF_BUILD_VARS+=" TF_NEED_JEMALLOC=1"
TF_BUILD_VARS+=" TF_ENABLE_XLA=0"
TF_BUILD_VARS+=" TF_NEED_S3=0"
TF_BUILD_VARS+=" TF_NEED_IGNITE=0"
TF_BUILD_VARS+=" TF_NEED_ROCM=0"

BAZEL_VERSION="0.15.0"
# BAZEL_AVALIABLE_RAM=1536 # MB
Expand All @@ -27,6 +29,7 @@ BAZEL_COPT_FLAGS+=" --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"
BAZEL_COPT_FLAGS+=" --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"
BAZEL_COPT_FLAGS+=" --config=monolithic --copt=-funsafe-math-optimizations"
BAZEL_COPT_FLAGS+=" --copt=-ftree-vectorize --copt=-fomit-frame-pointer --copt=-DRASPBERRY_PI"
BAZEL_COPT_FLAGS+=" --config=noaws --config=nogcp --config=nohdfs --config=nokafka --config=noignite"

BAZEL_EXTRA_FLAGS="--cpu=armeabi --crosstool_top=//tools/local_arm_compiler:toolchain //tensorflow/tools/pip_package:build_pip_package"

Expand Down
4 changes: 3 additions & 1 deletion build_tensorflow/configs/hikey960.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
TF_PATCH="yes"
TF_PYTHON_VERSION="3.5"
TF_VERSION="v1.12.0"

# export tensorflow variables to configure
Expand All @@ -15,6 +14,8 @@ TF_BUILD_VARS+=" TF_NEED_MKL=0"
TF_BUILD_VARS+=" TF_NEED_JEMALLOC=1"
TF_BUILD_VARS+=" TF_ENABLE_XLA=0"
TF_BUILD_VARS+=" TF_NEED_S3=0"
TF_BUILD_VARS+=" TF_NEED_IGNITE=0"
TF_BUILD_VARS+=" TF_NEED_ROCM=0"

BAZEL_VERSION="0.15.0"
# BAZEL_AVALIABLE_RAM=1536 # MB
Expand All @@ -25,6 +26,7 @@ BAZEL_VERSION="0.15.0"
BAZEL_COPT_FLAGS="--copt=-march=armv8-a+crc+simd --copt=-mtune=cortex-a73.cortex-a53"
BAZEL_COPT_FLAGS+=" --config=monolithic --copt=-funsafe-math-optimizations"
BAZEL_COPT_FLAGS+=" --copt=-ftree-vectorize --copt=-fomit-frame-pointer --copt=-DRASPBERRY_PI --copt=-D_GLIBCXX_USE_CXX11_ABI=0"
BAZEL_COPT_FLAGS+=" --config=noaws --config=nogcp --config=nohdfs --config=nokafka --config=noignite"
BAZEL_EXTRA_FLAGS=" --cpu=armeabi --crosstool_top=//tools/local_arm_compiler:toolchain //tensorflow/tools/pip_package:build_pip_package //tensorflow:libtensorflow_cc.so //tensorflow:libtensorflow.so"

CROSSTOOL_COMPILER="yes"
Expand Down
5 changes: 4 additions & 1 deletion build_tensorflow/configs/odroidc1.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TF_PATCH="no"
TF_PATCH="yes"
TF_VERSION="v1.12.0"

# export tensorflow variables to configure
Expand All @@ -14,6 +14,8 @@ TF_BUILD_VARS+=" TF_NEED_MKL=0"
TF_BUILD_VARS+=" TF_NEED_JEMALLOC=1"
TF_BUILD_VARS+=" TF_ENABLE_XLA=0"
TF_BUILD_VARS+=" TF_NEED_S3=0"
TF_BUILD_VARS+=" TF_NEED_IGNITE=0"
TF_BUILD_VARS+=" TF_NEED_ROCM=0"

BAZEL_VERSION="0.15.0"
# BAZEL_AVALIABLE_RAM=1536 # MB
Expand All @@ -27,6 +29,7 @@ BAZEL_COPT_FLAGS+=" --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"
BAZEL_COPT_FLAGS+=" --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"
BAZEL_COPT_FLAGS+=" --config=monolithic --copt=-funsafe-math-optimizations"
BAZEL_COPT_FLAGS+=" --copt=-ftree-vectorize --copt=-fomit-frame-pointer --copt=-DRASPBERRY_PI"
BAZEL_COPT_FLAGS+=" --config=noaws --config=nogcp --config=nohdfs --config=nokafka --config=noignite"
BAZEL_EXTRA_FLAGS="--cpu=armeabi --crosstool_top=//tools/local_arm_compiler:toolchain //tensorflow/tools/pip_package:build_pip_package"

CROSSTOOL_COMPILER="yes"
Expand Down
3 changes: 3 additions & 0 deletions build_tensorflow/configs/odroidc2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ TF_BUILD_VARS+=" TF_NEED_MKL=0"
TF_BUILD_VARS+=" TF_NEED_JEMALLOC=1"
TF_BUILD_VARS+=" TF_ENABLE_XLA=0"
TF_BUILD_VARS+=" TF_NEED_S3=0"
TF_BUILD_VARS+=" TF_NEED_IGNITE=0"
TF_BUILD_VARS+=" TF_NEED_ROCM=0"

BAZEL_VERSION="0.15.0"
# BAZEL_AVALIABLE_RAM=1536 # MB
Expand All @@ -25,6 +27,7 @@ BAZEL_COPT_FLAGS="--copt=-march=armv8-a+crc+simd --copt=-mtune=cortex-a53"
BAZEL_COPT_FLAGS+=" --copt=-std=c++11 --copt=-DS_IREAD=S_IRUSR --copt=-DS_IWRITE=S_IWUSR"
BAZEL_COPT_FLAGS+=" --config=monolithic --copt=-funsafe-math-optimizations"
BAZEL_COPT_FLAGS+=" --copt=-ftree-vectorize --copt=-fomit-frame-pointer --copt=-DRASPBERRY_PI"
BAZEL_COPT_FLAGS+=" --config=noaws --config=nogcp --config=nohdfs --config=nokafka --config=noignite"
BAZEL_EXTRA_FLAGS="--cpu=armeabi --crosstool_top=//tools/local_arm_compiler:toolchain //tensorflow/tools/pip_package:build_pip_package"

CROSSTOOL_COMPILER="yes"
Expand Down
5 changes: 4 additions & 1 deletion build_tensorflow/configs/odroidxu4.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TF_PATCH="no"
TF_PATCH="yes"
TF_VERSION="v1.12.0"

# export tensorflow variables to configure
Expand All @@ -14,6 +14,8 @@ TF_BUILD_VARS+=" TF_NEED_MKL=0"
TF_BUILD_VARS+=" TF_NEED_JEMALLOC=1"
TF_BUILD_VARS+=" TF_ENABLE_XLA=0"
TF_BUILD_VARS+=" TF_NEED_S3=0"
TF_BUILD_VARS+=" TF_NEED_IGNITE=0"
TF_BUILD_VARS+=" TF_NEED_ROCM=0"

BAZEL_VERSION="0.15.0"
# BAZEL_AVALIABLE_RAM=1536 # MB
Expand All @@ -27,6 +29,7 @@ BAZEL_COPT_FLAGS+=" --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"
BAZEL_COPT_FLAGS+=" --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"
BAZEL_COPT_FLAGS+=" --config=monolithic --copt=-funsafe-math-optimizations"
BAZEL_COPT_FLAGS+=" --copt=-ftree-vectorize --copt=-fomit-frame-pointer --copt=-DRASPBERRY_PI"
BAZEL_COPT_FLAGS+=" --config=noaws --config=nogcp --config=nohdfs --config=nokafka --config=noignite"
BAZEL_EXTRA_FLAGS="--cpu=armeabi --crosstool_top=//tools/local_arm_compiler:toolchain //tensorflow/tools/pip_package:build_pip_package"

CROSSTOOL_COMPILER="yes"
Expand Down
5 changes: 4 additions & 1 deletion build_tensorflow/configs/rpi.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TF_PATCH="no"
TF_PATCH="yes"
TF_VERSION="v1.12.0"

# export tensorflow variables to configure
Expand All @@ -14,6 +14,8 @@ TF_BUILD_VARS+=" TF_NEED_MKL=0"
TF_BUILD_VARS+=" TF_NEED_JEMALLOC=1"
TF_BUILD_VARS+=" TF_ENABLE_XLA=0"
TF_BUILD_VARS+=" TF_NEED_S3=0"
TF_BUILD_VARS+=" TF_NEED_IGNITE=0"
TF_BUILD_VARS+=" TF_NEED_ROCM=0"

BAZEL_VERSION="0.15.0"
# BAZEL_AVALIABLE_RAM=1536 # MB
Expand All @@ -27,6 +29,7 @@ BAZEL_COPT_FLAGS+=" --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"
BAZEL_COPT_FLAGS+=" --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 --copt=-U__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"
BAZEL_COPT_FLAGS+=" --config=monolithic --copt=-funsafe-math-optimizations"
BAZEL_COPT_FLAGS+=" --copt=-ftree-vectorize --copt=-fomit-frame-pointer --copt=-DRASPBERRY_PI"
BAZEL_COPT_FLAGS+=" --config=noaws --config=nogcp --config=nohdfs --config=nokafka --config=noignite"
BAZEL_EXTRA_FLAGS="--cpu=armeabi --crosstool_top=//tools/local_arm_compiler:toolchain //tensorflow/tools/pip_package:build_pip_package"

CROSSTOOL_COMPILER="yes"
Expand Down
5 changes: 4 additions & 1 deletion build_tensorflow/configs/rpi_one.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TF_PATCH="no"
TF_PATCH="yes"
TF_VERSION="v1.12.0"

# export tensorflow variables to configure
Expand All @@ -14,6 +14,8 @@ TF_BUILD_VARS+=" TF_NEED_MKL=0"
TF_BUILD_VARS+=" TF_NEED_JEMALLOC=1"
TF_BUILD_VARS+=" TF_ENABLE_XLA=0"
TF_BUILD_VARS+=" TF_NEED_S3=0"
TF_BUILD_VARS+=" TF_NEED_IGNITE=0"
TF_BUILD_VARS+=" TF_NEED_ROCM=0"

BAZEL_VERSION="0.15.0"
# BAZEL_AVALIABLE_RAM=1536 # MB
Expand All @@ -25,6 +27,7 @@ BAZEL_COPT_FLAGS="--copt=-march=armv6 --copt=-mfpu=vfp"
BAZEL_COPT_FLAGS+=" --copt=-std=gnu11 --copt=-DS_IREAD=S_IRUSR --copt=-DS_IWRITE=S_IWUSR"
BAZEL_COPT_FLAGS+=" --config=monolithic --copt=-funsafe-math-optimizations"
BAZEL_COPT_FLAGS+=" --copt=-ftree-vectorize --copt=-fomit-frame-pointer --copt=-DRASPBERRY_PI"
BAZEL_COPT_FLAGS+=" --config=noaws --config=nogcp --config=nohdfs --config=nokafka --config=noignite"
BAZEL_EXTRA_FLAGS="--cpu=armeabi --crosstool_top=//tools/local_arm_compiler:toolchain //tensorflow/tools/pip_package:build_pip_package"

CROSSTOOL_COMPILER="yes"
Expand Down
5 changes: 4 additions & 1 deletion build_tensorflow/configs/rpi_one_openblas.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# see: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/ci_build/pi/build_raspberry_pi.sh
OPENBLAS_PATH="/tmp/openblas_install"

TF_PATCH="no"
TF_PATCH="yes"
TF_VERSION="v1.12.0"

# export tensorflow variables to configure
Expand All @@ -18,6 +18,8 @@ TF_BUILD_VARS+=" TF_NEED_MKL=0"
TF_BUILD_VARS+=" TF_NEED_JEMALLOC=1"
TF_BUILD_VARS+=" TF_ENABLE_XLA=0"
TF_BUILD_VARS+=" TF_NEED_S3=0"
TF_BUILD_VARS+=" TF_NEED_IGNITE=0"
TF_BUILD_VARS+=" TF_NEED_ROCM=0"

BAZEL_VERSION="0.15.0"
# BAZEL_AVALIABLE_RAM=1536 # MB
Expand All @@ -30,6 +32,7 @@ BAZEL_COPT_FLAGS+=" --copt=-std=gnu11 --copt=-DS_IREAD=S_IRUSR --copt=-DS_IWRITE
BAZEL_COPT_FLAGS+=" --config=monolithic --copt=-funsafe-math-optimizations"
BAZEL_COPT_FLAGS+=" --copt=-ftree-vectorize --copt=-fomit-frame-pointer --copt=-DRASPBERRY_PI"
BAZEL_COPT_FLAGS+=" --copt=-isystem --copt=${OPENBLAS_PATH}/include/ --linkopt=-L${OPENBLAS_PATH}/lib/ --linkopt=-l:libopenblas.a"
BAZEL_COPT_FLAGS+=" --config=noaws --config=nogcp --config=nohdfs --config=nokafka --config=noignite"
BAZEL_EXTRA_FLAGS="--cpu=armeabi --crosstool_top=//tools/local_arm_compiler:toolchain //tensorflow/tools/pip_package:build_pip_package"

CROSSTOOL_COMPILER="yes"
Expand Down
4 changes: 2 additions & 2 deletions build_tensorflow/patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PATCH_DIR="$(dirname ${BASH_SOURCE[0]})"
function bazel_patch()
{
[ ! -d "${PATCH_DIR}/patch/bazel/${BAZEL_VERSION}" ] && return 0
for f in $(find "${PATCH_DIR}/patch/bazel/${BAZEL_VERSION}" -type f); do
for f in $(find "${PATCH_DIR}/patch/bazel/${BAZEL_VERSION}" -type f | sort); do
patch -p1 < "$f" || return 1
done
return 0
Expand All @@ -14,7 +14,7 @@ function bazel_patch()
function tf_patch()
{
[ ! -d "${PATCH_DIR}/patch/tensorflow/${TF_VERSION}" ] && return 0
for f in $(find "${PATCH_DIR}/patch/tensorflow/${TF_VERSION}" -type f); do
for f in $(find "${PATCH_DIR}/patch/tensorflow/${TF_VERSION}" -type f | sort); do
git apply "$f" || return 1
done
return 0
Expand Down
Loading

0 comments on commit 2c34667

Please sign in to comment.