From efed6abd6d8f4ee3b932081d7185c1aef2838f86 Mon Sep 17 00:00:00 2001 From: Adam Pocock Date: Fri, 16 Sep 2022 15:25:26 -0400 Subject: [PATCH 1/5] Bumping to 0.4.2-SNAPSHOT. --- pom.xml | 2 +- tensorflow-core/pom.xml | 2 +- tensorflow-core/tensorflow-core-api/pom.xml | 2 +- tensorflow-core/tensorflow-core-generator/pom.xml | 2 +- tensorflow-core/tensorflow-core-platform-gpu/pom.xml | 2 +- tensorflow-core/tensorflow-core-platform/pom.xml | 2 +- tensorflow-framework/pom.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 38e35f46fa5..3b05b6f809d 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.tensorflow tensorflow-java - 0.4.1 + 0.4.2-SNAPSHOT pom TensorFlow Java Parent diff --git a/tensorflow-core/pom.xml b/tensorflow-core/pom.xml index 4cfa9dc6abd..a546f99a007 100644 --- a/tensorflow-core/pom.xml +++ b/tensorflow-core/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-java - 0.4.1 + 0.4.2-SNAPSHOT tensorflow-core pom diff --git a/tensorflow-core/tensorflow-core-api/pom.xml b/tensorflow-core/tensorflow-core-api/pom.xml index 331c62216dd..14053a831e6 100644 --- a/tensorflow-core/tensorflow-core-api/pom.xml +++ b/tensorflow-core/tensorflow-core-api/pom.xml @@ -6,7 +6,7 @@ org.tensorflow tensorflow-core - 0.4.1 + 0.4.2-SNAPSHOT tensorflow-core-api jar diff --git a/tensorflow-core/tensorflow-core-generator/pom.xml b/tensorflow-core/tensorflow-core-generator/pom.xml index 3fbd73ca2c6..2479cb6a640 100644 --- a/tensorflow-core/tensorflow-core-generator/pom.xml +++ b/tensorflow-core/tensorflow-core-generator/pom.xml @@ -5,7 +5,7 @@ org.tensorflow tensorflow-core - 0.4.1 + 0.4.2-SNAPSHOT tensorflow-core-generator jar diff --git a/tensorflow-core/tensorflow-core-platform-gpu/pom.xml b/tensorflow-core/tensorflow-core-platform-gpu/pom.xml index fca1af5b785..e401c81cc46 100644 --- a/tensorflow-core/tensorflow-core-platform-gpu/pom.xml +++ b/tensorflow-core/tensorflow-core-platform-gpu/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-core - 0.4.1 + 0.4.2-SNAPSHOT tensorflow-core-platform-gpu TensorFlow Core API Library Platform GPU diff --git a/tensorflow-core/tensorflow-core-platform/pom.xml b/tensorflow-core/tensorflow-core-platform/pom.xml index a84fc2c4436..a4a6b897f0a 100644 --- a/tensorflow-core/tensorflow-core-platform/pom.xml +++ b/tensorflow-core/tensorflow-core-platform/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-core - 0.4.1 + 0.4.2-SNAPSHOT tensorflow-core-platform TensorFlow Core API Library Platform diff --git a/tensorflow-framework/pom.xml b/tensorflow-framework/pom.xml index 5a33d5c14c4..f52b6fa42d7 100644 --- a/tensorflow-framework/pom.xml +++ b/tensorflow-framework/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-java - 0.4.1 + 0.4.2-SNAPSHOT tensorflow-framework jar From 2b9eca8bf381faac94b35dcd51e29244ad6fd05b Mon Sep 17 00:00:00 2001 From: Adam Pocock Date: Fri, 16 Sep 2022 15:25:53 -0400 Subject: [PATCH 2/5] Upgrading to TF 2.7.4. --- tensorflow-core/tensorflow-core-api/.bazelversion | 2 +- tensorflow-core/tensorflow-core-api/WORKSPACE | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tensorflow-core/tensorflow-core-api/.bazelversion b/tensorflow-core/tensorflow-core-api/.bazelversion index 0b2eb36f508..fae6e3d04b2 100644 --- a/tensorflow-core/tensorflow-core-api/.bazelversion +++ b/tensorflow-core/tensorflow-core-api/.bazelversion @@ -1 +1 @@ -3.7.2 +4.2.1 diff --git a/tensorflow-core/tensorflow-core-api/WORKSPACE b/tensorflow-core/tensorflow-core-api/WORKSPACE index 0ac4d82a193..683082740a2 100644 --- a/tensorflow-core/tensorflow-core-api/WORKSPACE +++ b/tensorflow-core/tensorflow-core-api/WORKSPACE @@ -16,12 +16,12 @@ http_archive( ], patch_tool = "patch", patch_args = ["-p1"], - patch_cmds = ["grep -rl 'java_package' tensorflow/core | xargs sed -i.bak 's/^\(.* java_package = \"org\.tensorflow\.\)\(.*\"\)/\\1proto.\\2'/"], + 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/refs/tags/v2.7.1.tar.gz", + "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.7.4.tar.gz", ], - sha256 = "abebe2cf5ca379e18071693ca5f45b88ade941b16258a21cc1f12d77d5387a21", - strip_prefix = "tensorflow-2.7.1" + sha256 = "75b2e40a9623df32da16d8e97528f5e02e4a958e23b1f2ee9637be8eec5d021b", + strip_prefix = "tensorflow-2.7.4" ) # START: Upstream TensorFlow dependencies From c11fd6b309b19502f6d30cdf5066ac3d4730b6d9 Mon Sep 17 00:00:00 2001 From: Adam Pocock Date: Wed, 24 Aug 2022 22:20:05 -0400 Subject: [PATCH 3/5] Adding a hook for loading TF IO native libraries (#468) --- .../main/java/org/tensorflow/TensorFlow.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFlow.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFlow.java index 53748b82271..a25aa38c2f6 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFlow.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/TensorFlow.java @@ -1,4 +1,4 @@ -/* Copyright 2019-2021 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2019-2022 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import static org.tensorflow.internal.c_api.global.tensorflow.TF_GetAllOpList; import static org.tensorflow.internal.c_api.global.tensorflow.TF_GetOpList; import static org.tensorflow.internal.c_api.global.tensorflow.TF_LoadLibrary; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_RegisterFilesystemPlugin; import static org.tensorflow.internal.c_api.global.tensorflow.TF_Version; import com.google.protobuf.InvalidProtocolBufferException; @@ -108,6 +109,21 @@ public static OpList loadLibrary(String filename) { } } + /** + * Loads the filesystem plugin from filename and registers all the filesystems it supports. + * + *

Throws a TF runtime exception if the plugin failed to load. + * + * @param filename Path of the dynamic library containing the filesystem support. + */ + public static void registerFilesystemPlugin(String filename) { + try (PointerScope scope = new PointerScope()) { + TF_Status status = TF_Status.newStatus(); + TF_RegisterFilesystemPlugin(filename, status); + status.throwExceptionIfNotOK(); + } + } + private static TF_Library libraryLoad(String filename) { try (PointerScope scope = new PointerScope()) { TF_Status status = TF_Status.newStatus(); From 7ecab567f29e2c531e6a55c66b1da836f422ddf5 Mon Sep 17 00:00:00 2001 From: Adam Pocock Date: Fri, 16 Sep 2022 15:30:57 -0400 Subject: [PATCH 4/5] Tagging v0.4.2 --- README.md | 33 ++++++++++--------- docs/install.md | 4 +-- pom.xml | 2 +- tensorflow-core/pom.xml | 2 +- tensorflow-core/tensorflow-core-api/pom.xml | 2 +- .../tensorflow-core-generator/pom.xml | 2 +- .../tensorflow-core-platform-gpu/pom.xml | 2 +- .../tensorflow-core-platform/pom.xml | 2 +- tensorflow-framework/pom.xml | 2 +- 9 files changed, 26 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index e7ec2098707..c276abbd4f9 100644 --- a/README.md +++ b/README.md @@ -56,12 +56,12 @@ systems, you should add the following dependencies: org.tensorflow tensorflow-core-api - 0.4.1 + 0.4.2 org.tensorflow tensorflow-core-api - 0.4.1 + 0.4.2 linux-x86_64${javacpp.platform.extension} ``` @@ -72,24 +72,24 @@ native dependencies as follows: org.tensorflow tensorflow-core-api - 0.4.1 + 0.4.2 org.tensorflow tensorflow-core-api - 0.4.1 + 0.4.2 linux-x86_64${javacpp.platform.extension} org.tensorflow tensorflow-core-api - 0.4.1 + 0.4.2 macosx-x86_64${javacpp.platform.extension} org.tensorflow tensorflow-core-api - 0.4.1 + 0.4.2 windows-x86_64${javacpp.platform.extension} ``` @@ -102,7 +102,7 @@ artifact includes transitively all the artifacts above as a single dependency: org.tensorflow tensorflow-core-platform${javacpp.platform.extension} - 0.4.1 + 0.4.2 ``` @@ -141,15 +141,16 @@ to add Sonatype OSS repository in your pom.xml, like the following This table shows the mapping between different version of TensorFlow for Java and the core runtime libraries. -| TensorFlow Java Version | TensorFlow Version | -| ------------- | ------------- | -| 0.2.0 | 2.3.1 | -| 0.3.0 | 2.4.1 | -| 0.3.1 | 2.4.1 | -| 0.3.2 | 2.4.1 | -| 0.3.3 | 2.4.1 | -| 0.4.0 | 2.7.0 | -| 0.4.1 | 2.7.1 | +| TensorFlow Java Version | TensorFlow Version | +|-------------------------|--------------------| +| 0.2.0 | 2.3.1 | +| 0.3.0 | 2.4.1 | +| 0.3.1 | 2.4.1 | +| 0.3.2 | 2.4.1 | +| 0.3.3 | 2.4.1 | +| 0.4.0 | 2.7.0 | +| 0.4.1 | 2.7.1 | +| 0.4.2 | 2.7.4 | ## How to Contribute? diff --git a/docs/install.md b/docs/install.md index 4691f4ffccd..a4c4a681f9d 100644 --- a/docs/install.md +++ b/docs/install.md @@ -64,7 +64,7 @@ For example, org.tensorflow tensorflow-core-platform - 0.4.1 + 0.4.2 ``` @@ -170,7 +170,7 @@ add the TensorFlow dependency to the project's `pom.xml` file: org.tensorflow tensorflow-core-platform - 0.4.1 + 0.4.2 diff --git a/pom.xml b/pom.xml index 3b05b6f809d..c9bc65464e0 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.tensorflow tensorflow-java - 0.4.2-SNAPSHOT + 0.4.2 pom TensorFlow Java Parent diff --git a/tensorflow-core/pom.xml b/tensorflow-core/pom.xml index a546f99a007..ce6b3cf90b6 100644 --- a/tensorflow-core/pom.xml +++ b/tensorflow-core/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-java - 0.4.2-SNAPSHOT + 0.4.2 tensorflow-core pom diff --git a/tensorflow-core/tensorflow-core-api/pom.xml b/tensorflow-core/tensorflow-core-api/pom.xml index 14053a831e6..3806cefdcbc 100644 --- a/tensorflow-core/tensorflow-core-api/pom.xml +++ b/tensorflow-core/tensorflow-core-api/pom.xml @@ -6,7 +6,7 @@ org.tensorflow tensorflow-core - 0.4.2-SNAPSHOT + 0.4.2 tensorflow-core-api jar diff --git a/tensorflow-core/tensorflow-core-generator/pom.xml b/tensorflow-core/tensorflow-core-generator/pom.xml index 2479cb6a640..6ab592e3663 100644 --- a/tensorflow-core/tensorflow-core-generator/pom.xml +++ b/tensorflow-core/tensorflow-core-generator/pom.xml @@ -5,7 +5,7 @@ org.tensorflow tensorflow-core - 0.4.2-SNAPSHOT + 0.4.2 tensorflow-core-generator jar diff --git a/tensorflow-core/tensorflow-core-platform-gpu/pom.xml b/tensorflow-core/tensorflow-core-platform-gpu/pom.xml index e401c81cc46..7d4679b218e 100644 --- a/tensorflow-core/tensorflow-core-platform-gpu/pom.xml +++ b/tensorflow-core/tensorflow-core-platform-gpu/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-core - 0.4.2-SNAPSHOT + 0.4.2 tensorflow-core-platform-gpu TensorFlow Core API Library Platform GPU diff --git a/tensorflow-core/tensorflow-core-platform/pom.xml b/tensorflow-core/tensorflow-core-platform/pom.xml index a4a6b897f0a..0805f8f3f5d 100644 --- a/tensorflow-core/tensorflow-core-platform/pom.xml +++ b/tensorflow-core/tensorflow-core-platform/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-core - 0.4.2-SNAPSHOT + 0.4.2 tensorflow-core-platform TensorFlow Core API Library Platform diff --git a/tensorflow-framework/pom.xml b/tensorflow-framework/pom.xml index f52b6fa42d7..aeca7bad785 100644 --- a/tensorflow-framework/pom.xml +++ b/tensorflow-framework/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-java - 0.4.2-SNAPSHOT + 0.4.2 tensorflow-framework jar From f13ec1638d7b6232d2d764773ebd6d3f0425d9dc Mon Sep 17 00:00:00 2001 From: Adam Pocock Date: Fri, 16 Sep 2022 15:44:32 -0400 Subject: [PATCH 5/5] Bumping bazel version in CI. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 384d68f7f49..5d9e7b62986 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,7 +105,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.7.2/bazel-3.7.2-installer-linux-x86_64.sh -o bazel.sh --retry 10 + curl -L https://github.com/bazelbuild/bazel/releases/download/4.2.1/bazel-4.2.1-installer-linux-x86_64.sh -o bazel.sh --retry 10 bash bazel.sh if [[ "${{ matrix.ext }}" == *-gpu ]]; then echo Installing CUDA @@ -160,7 +160,7 @@ jobs: run: | python3 -m pip install numpy six echo Downloading Bazel - 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 + curl -L https://github.com/bazelbuild/bazel/releases/download/4.2.1/bazel-4.2.1-installer-darwin-x86_64.sh -o bazel.sh --retry 10 bash bazel.sh brew install libomp perl - name: Checkout repository @@ -209,7 +209,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.7.2/bazel-3.7.2-windows-x86_64.exe -o C:/bazel/bazel.exe --retry 10 + curl.exe -L https://github.com/bazelbuild/bazel/releases/download/4.2.1/bazel-4.2.1-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