Skip to content

Upgrade for TensorFlow 2.5.0 #303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
needs: prepare
strategy:
matrix:
ext: ["", -mkl, -gpu] #, -mkl-gpu]
ext: ["", -gpu] #, -mkl, -mkl-gpu]
steps:
- name: Install environment
run: |
Expand All @@ -104,7 +104,7 @@ jobs:
tar xzf $HOME/apache-maven-3.6.3-bin.tar.gz -C /opt/
ln -sf /opt/apache-maven-3.6.3/bin/mvn /usr/bin/mvn
echo Downloading Bazel
curl -L https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-installer-linux-x86_64.sh -o bazel.sh --retry 10
curl -L https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel-3.7.2-installer-linux-x86_64.sh -o bazel.sh --retry 10
bash bazel.sh
if [[ "${{ matrix.ext }}" == *-gpu ]]; then
echo Installing CUDA
Expand Down Expand Up @@ -153,13 +153,13 @@ jobs:
needs: prepare
strategy:
matrix:
ext: ["", -mkl]
ext: [""] # , -mkl]
steps:
- name: Install environment
run: |
python3 -m pip install numpy six
echo Downloading Bazel
curl -L https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-installer-darwin-x86_64.sh -o bazel.sh --retry 10
curl -L https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel-3.7.2-installer-darwin-x86_64.sh -o bazel.sh --retry 10
bash bazel.sh
brew install libomp perl
- name: Checkout repository
Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:
needs: prepare
strategy:
matrix:
ext: ["", -gpu, -mkl] #, -mkl-gpu]
ext: ["", -gpu] #, -mkl, -mkl-gpu]
steps:
- name: Configure page file
uses: al-cheb/[email protected]
Expand All @@ -208,7 +208,7 @@ jobs:
bash.exe -lc "find 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/' -iname '14.1*' -exec rm -Rf {} \;"
echo Downloading Bazel
mkdir C:\bazel
curl.exe -L https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-windows-x86_64.exe -o C:/bazel/bazel.exe --retry 10
curl.exe -L https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel-3.7.2-windows-x86_64.exe -o C:/bazel/bazel.exe --retry 10
set "EXT=${{ matrix.ext }}"
if "%EXT:~-4%" == "-gpu" (
echo Removing some unused stuff to avoid running out of disk space
Expand Down
5 changes: 3 additions & 2 deletions tensorflow-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@
</activation>
<modules>
<module>tensorflow-core-platform</module>
<module>tensorflow-core-platform-mkl</module>
<module>tensorflow-core-platform-mkl-gpu</module>
<module>tensorflow-core-platform-gpu</module>
<!-- Disabling MKL builds until they are more stable and performant -->
<!--module>tensorflow-core-platform-mkl</module-->
<!--module>tensorflow-core-platform-mkl-gpu</module-->
</modules>
</profile>

Expand Down
34 changes: 32 additions & 2 deletions tensorflow-core/tensorflow-core-api/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ build --define open_source_build=true
test --define open_source_build=true

# For workaround https://github.com/bazelbuild/bazel/issues/8772 with Bazel >= 0.29.1
build --java_toolchain=@org_tensorflow//third_party/toolchains/java:tf_java_toolchain
build --host_java_toolchain=@org_tensorflow//third_party/toolchains/java:tf_java_toolchain
build --java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain
build --host_java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain

# Please note that MKL on MacOS or windows is still not supported.
# If you would like to use a local MKL instead of downloading, please set the
Expand Down Expand Up @@ -616,3 +616,33 @@ build:release_gpu_linux_cuda_10_1 --config=release_gpu_linux
build:release_gpu_linux_cuda_10_1 --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda-10.1"
build:release_gpu_linux_cuda_10_1 --action_env=TF_CUDA_VERSION="10"
build:release_gpu_linux_cuda_10_1 --action_env=TF_CUDNN_VERSION="7"

# Address sanitizer
# CC=clang bazel build --config asan
build:asan --strip=never
build:asan --copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER
build:asan --copt -g
build:asan --copt -O3
build:asan --copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address

# Memory sanitizer
# CC=clang bazel build --config msan
build:msan --strip=never
build:msan --copt -fsanitize=memory
build:msan --copt -DADDRESS_SANITIZER
build:msan --copt -g
build:msan --copt -O3
build:msan --copt -fno-omit-frame-pointer
build:msan --linkopt -fsanitize=memory

# Undefined Behavior Sanitizer
# CC=clang bazel build --config ubsan
build:ubsan --strip=never
build:ubsan --copt -fsanitize=undefined
build:ubsan --copt -g
build:ubsan --copt -O3
build:ubsan --copt -fno-omit-frame-pointer
build:ubsan --linkopt -fsanitize=undefined
build:ubsan --linkopt -lubsan
33 changes: 18 additions & 15 deletions tensorflow-core/tensorflow-core-api/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,31 @@ http_archive(
patch_args = ["-p1"],
patch_cmds = ["grep -rl 'java_package' tensorflow/core | xargs sed -i.bak 's/^\(.* java_package = \"org\.tensorflow\.\)\(.*\"\)/\\1proto.\\2'/"],
urls = [
"https://github.com/tensorflow/tensorflow/archive/v2.4.1.tar.gz",
"https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.5.0.tar.gz",
],
sha256 = "f681331f8fc0800883761c7709d13cda11942d4ad5ff9f44ad855e9dc78387e0",
strip_prefix = "tensorflow-2.4.1"
sha256 = "233875ea27fc357f6b714b2a0de5f6ff124b50c1ee9b3b41f9e726e9e677b86c",
strip_prefix = "tensorflow-2.5.0"
)

# START: Upstream TensorFlow dependencies
# TensorFlow build depends on these dependencies.
# Needs to be in-sync with TensorFlow sources.
http_archive(
name = "io_bazel_rules_closure",
sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9",
strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz",
"https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", # 2019-06-13
],
)
# END: Upstream TensorFlow dependencies
load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3")

tf_workspace3()

load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace")
tf_workspace()
load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2")

tf_workspace2()

load("@org_tensorflow//tensorflow:workspace1.bzl", "tf_workspace1")

tf_workspace1()

load("@org_tensorflow//tensorflow:workspace0.bzl", "tf_workspace0")

tf_workspace0()
# END: Upstream TensorFlow dependencies

load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
grpc_deps()
Expand Down
13 changes: 7 additions & 6 deletions tensorflow-core/tensorflow-core-api/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ done
echo "Listing $TENSORFLOW_BIN:" && ls -l $TENSORFLOW_BIN

if [[ -x /usr/bin/install_name_tool ]] && [[ -e $BAZEL_BIN/external/llvm_openmp/libiomp5.dylib ]]; then
# Fix library with correct rpath on Mac
chmod +w $BAZEL_BIN/external/llvm_openmp/libiomp5.dylib $TENSORFLOW_BIN/libtensorflow_cc.2.dylib $TENSORFLOW_BIN/libtensorflow_framework.2.dylib
UGLYPATH=$(otool -L $TENSORFLOW_BIN/libtensorflow_cc.2.dylib | grep @loader_path | cut -f1 -d ' ')
install_name_tool -add_rpath @loader_path/. -id @rpath/libiomp5.dylib $BAZEL_BIN/external/llvm_openmp/libiomp5.dylib
install_name_tool -change $UGLYPATH @rpath/libiomp5.dylib $TENSORFLOW_BIN/libtensorflow_cc.2.dylib
install_name_tool -change $UGLYPATH @rpath/libiomp5.dylib $TENSORFLOW_BIN/libtensorflow_framework.2.dylib
# Fix library with correct rpath on Mac
chmod +w $BAZEL_BIN/external/llvm_openmp/libiomp5.dylib $TENSORFLOW_BIN/libtensorflow_cc.2.dylib $TENSORFLOW_BIN/libtensorflow_framework.2.dylib
UGLYPATH=$(otool -L $TENSORFLOW_BIN/libtensorflow_cc.2.dylib | grep @loader_path | cut -f1 -d ' ')
echo $UGLYPATH
install_name_tool -add_rpath @loader_path/. -id @rpath/libiomp5.dylib $BAZEL_BIN/external/llvm_openmp/libiomp5.dylib
install_name_tool -change $UGLYPATH @rpath/libiomp5.dylib $TENSORFLOW_BIN/libtensorflow_cc.2.dylib
install_name_tool -change $UGLYPATH @rpath/libiomp5.dylib $TENSORFLOW_BIN/libtensorflow_framework.2.dylib
fi

GEN_SRCS_DIR=src/gen/java
Expand Down
Loading