From 185afd84bc8f99201344c41ed90cd42f281d1a57 Mon Sep 17 00:00:00 2001 From: Karl Lessard Date: Fri, 8 Nov 2024 15:19:20 -0500 Subject: [PATCH 1/5] Download wheel on native builds --- tensorflow-core/tensorflow-core-native/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow-core/tensorflow-core-native/pom.xml b/tensorflow-core/tensorflow-core-native/pom.xml index 330bc403bde..7190266d00e 100644 --- a/tensorflow-core/tensorflow-core-native/pom.xml +++ b/tensorflow-core/tensorflow-core-native/pom.xml @@ -72,7 +72,7 @@ false false false - true + false From 76e2c0f4b1a7cd05cf1de927a653987dd5801251 Mon Sep 17 00:00:00 2001 From: Karl Lessard Date: Tue, 24 Sep 2024 14:57:27 -0400 Subject: [PATCH 2/5] Add prefix to staging repo --- release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.sh b/release.sh index 01f99386a71..acd1041d766 100755 --- a/release.sh +++ b/release.sh @@ -34,7 +34,7 @@ fi # To get a shell to poke around the maven artifacts with. if [[ -z "${CMD}" ]] then - CMD="mvn clean deploy -B -e --settings ./settings.xml -Pdeploying -Preleasing -DstagingRepositoryId=${STAGING_SEQ}" + CMD="mvn clean deploy -B -e --settings ./settings.xml -Pdeploying -Preleasing -DstagingRepositoryId=orgtensorflow-${STAGING_SEQ}" fi export GPG_TTY=$(tty) From 909e5b33d143abcea9a4739b6f62942f461bf262 Mon Sep 17 00:00:00 2001 From: Karl Lessard Date: Fri, 18 Oct 2024 15:56:16 -0400 Subject: [PATCH 3/5] Update install instructions --- docs/install.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/install.md b/docs/install.md index c1a407b7db1..2dc2601b0e5 100644 --- a/docs/install.md +++ b/docs/install.md @@ -13,12 +13,14 @@ Caution: The TensorFlow Java API is *not* covered by the TensorFlow ## Requirements -TensorFlow Java runs on Java 8 and above, and supports out-of-the-box the +TensorFlow Java runs on Java 11 and above, and supports out-of-the-box the following platforms: -* Ubuntu 16.04 or higher; 64-bit, x86 -* macOS 10.12.6 (Sierra) or higher; 64-bit, x86 -* Windows 7 or higher; 64-bit, x86 +* Ubuntu 20.04 or higher; 64-bit, x86 +* Ubuntu 22.04 or higher; 64-bit, arm +* macOS 12 or higher; 64-bit, x86 +* macOS 14 or higher; 64-bit, arm +* Windows 10 or higher; 64-bit, x86 *Note: To use TensorFlow on Android, see [TensorFlow Lite](https://tensorflow.org/lite)* @@ -41,8 +43,7 @@ TensorFlow Java to your project. The easiest one is to add a dependency on the Core API and the native dependencies it requires to run on all supported platforms. -You can also select the `tensorflow-core-platform-gpu` extension instead, which -supports CUDA® on Linux and Windows platforms. +To include CUDA® support for Linux x86, select the `tensorflow-core-native:linux-x86_64-gpu` artifact. In addition, a separate dependency on the `tensorflow-framework` library can be added to benefit from a rich set of utilities for TensorFlow-based machine @@ -118,7 +119,7 @@ repositories { } dependencies { - compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '1.0.0-rc.1' + compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '1.0.0-rc.2' } ``` From 3769af5f7ca81771e66703de8cd4b17f82209292 Mon Sep 17 00:00:00 2001 From: Karl Lessard Date: Fri, 1 Nov 2024 16:28:28 -0400 Subject: [PATCH 4/5] Add instructions on how to include GPU support with TFJava 1.0.0 --- CONTRIBUTING.md | 5 ++--- MIGRATING.md | 18 ++++++++++++++++++ README.md | 2 +- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c66940295a1..874bdddaf52 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,8 +15,7 @@ For dependencies, we can use anything compliant with [this list](https://opensou ## Building -To build all the artifacts locally, simply invoke the command `mvn install` at the root of this repository (or the Maven command of your choice). It is also -possible to build artifacts with support for CUDA® by adding the `-Djavacpp.platform.extension=-gpu` argument to the Maven command. +To build all the artifacts locally, simply invoke the command `mvn install` at the root of this repository (or the Maven command of your choice). ### JDK 16+ @@ -35,7 +34,7 @@ This can be done in `.mvn/jvm.config` or `MAVEN_OPTS`. ### Native Builds By default, the build will attempt to download the existing TensorFlow binaries from the web for the platform it is running on (so you need to have an active internet connection). -If such binaries are not available for your platform, you will need to build the TensorFlow runtime library from sources, by appending the `-Dnative.build` argument to your Maven +If such binaries are not available for your platform, you will need to build the TensorFlow runtime library from sources, by appending the `-Pnative-build` argument to your Maven command. This requires a valid environment for building TensorFlow, including the [bazel](https://bazel.build/) build tool and a few Python dependencies (please read [TensorFlow documentation](https://www.tensorflow.org/install/source) for more details). Note that building from sources can take multiple hours on a regular laptop. diff --git a/MIGRATING.md b/MIGRATING.md index 1fc2c1d7620..44a1924a512 100644 --- a/MIGRATING.md +++ b/MIGRATING.md @@ -49,6 +49,24 @@ The Java Module (jigsaw) names has been updated to drop the leading `org.`, as f - `tensorflow-core-native` : `tensorflow.nativelib` - `tensorflow-framework` : `tensorflow.framework` (was `org.tensorflow.framework` before) +### GPU Support + +Previous versions of TF Java were building a `tensorflow-core-platform-gpu` artifact upon which application could depend +on to include any TensorFlow native library that GPU support enabled. Since TensorFlow has removed its support of GPU +on all platforms other that Linux, we removed our platform JAR in favour of simply adding a dependency on the +`linux-x86_64-gpu` native artifact. +```xml + + org.tensorflow + tensorflow-core-native + 1.0.0 + linux-x86_64-gpu + +``` +Please note that including this dependency won't work if your application also depends on `tensorflow-core-platform`. If +you need to support more platforms that Linux, you should include the other `tensorflow-core-native` dependencies +separately (see the [README](README.md) file). + ### Session Run Result In versions before 0.4.0 `Session.Runner.run` and `TensorFunction.call` returned a `List`. In newer versions diff --git a/README.md b/README.md index a5b748e220f..e48ba72e656 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Only one dependency can be added per platform, meaning that you cannot add nativ In some cases, it might be preferable to add a single dependency that includes transitively all the artifacts required to run TensorFlow Java on any [supported platforms](README.md#individual-dependencies) -- `tensorflow-core-platform`: Includes `tensorflow-core-api`, plus native artifacts for `linux-x86_64`, `macosx-arm64`, `macosx-x86_64` and `windows-x86_64` +- `tensorflow-core-platform`: Includes `tensorflow-core-api`, plus native artifacts for `linux-x86_64`, `linux-x86_64-arm64`, `macosx-arm64`, `macosx-x86_64` and `windows-x86_64` For example, to run TensorFlow Java on any CPU platform for which a binary is being distributed by this project, you can simply add this dependency to your application: From 5f2140ec4514b788892ef8d4d0e87d619928ce9d Mon Sep 17 00:00:00 2001 From: Karl Lessard Date: Fri, 8 Nov 2024 15:27:24 -0500 Subject: [PATCH 5/5] Releasing 1.0.0 --- README.md | 19 ++++++++++--------- docs/install.md | 8 ++++---- pom.xml | 2 +- tensorflow-core/pom.xml | 2 +- tensorflow-core/tensorflow-core-api/pom.xml | 2 +- .../tensorflow-core-generator/pom.xml | 2 +- .../tensorflow-core-native/pom.xml | 2 +- .../tensorflow-core-platform/pom.xml | 2 +- tensorflow-framework/pom.xml | 2 +- 9 files changed, 21 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index e48ba72e656..1df21073340 100644 --- a/README.md +++ b/README.md @@ -69,12 +69,12 @@ systems with no GPU support, you should add the following dependencies: org.tensorflow tensorflow-core-api - 1.0.0-rc.2 + 1.0.0 org.tensorflow tensorflow-core-native - 1.0.0-rc.2 + 1.0.0 linux-x86_64 ``` @@ -85,24 +85,24 @@ native dependencies as follows: org.tensorflow tensorflow-core-api - 1.0.0-rc.2 + 1.0.0 org.tensorflow tensorflow-core-native - 1.0.0-rc.2 + 1.0.0 linux-x86_64-gpu org.tensorflow tensorflow-core-native - 1.0.0-rc.2 + 1.0.0 macosx-arm64 org.tensorflow tensorflow-core-native - 1.0.0-rc.2 + 1.0.0 windows-x86_64 ``` @@ -123,7 +123,7 @@ simply add this dependency to your application: org.tensorflow tensorflow-core-platform - 1.0.0-rc.2 + 1.0.0 ``` @@ -153,7 +153,7 @@ to add Sonatype OSS repository in your pom.xml, like the following org.tensorflow tensorflow-core-platform - 1.0.0-SNAPSHOT + 1.1.0-SNAPSHOT ``` @@ -175,7 +175,8 @@ This table shows the mapping between TensorFlow, TensorFlow Java and minimum sup | 0.5.0 | 2.10.1 | 11 | | 1.0.0-rc.1 | 2.16.1 | 11 | | 1.0.0-rc.2 | 2.16.2 | 11 | -| 1.0.0-SNAPSHOT | 2.16.2 | 11 | +| 1.0.0 | 2.16.2 | 11 | +| 1.1.0-SNAPSHOT | 2.16.2 | 11 | ## How to Contribute? diff --git a/docs/install.md b/docs/install.md index 2dc2601b0e5..3c969c433dc 100644 --- a/docs/install.md +++ b/docs/install.md @@ -59,7 +59,7 @@ For example, org.tensorflow tensorflow-core-platform - 1.0.0-rc.2 + 1.0.0 ``` @@ -102,7 +102,7 @@ snapshots repository in your `pom.xml`. org.tensorflow tensorflow-core-platform - 1.0.0-SNAPSHOT + 1.1.0-SNAPSHOT ``` @@ -119,7 +119,7 @@ repositories { } dependencies { - compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '1.0.0-rc.2' + compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '1.0.0' } ``` @@ -165,7 +165,7 @@ add the TensorFlow dependency to the project's `pom.xml` file: org.tensorflow tensorflow-core-platform - 1.0.0-rc.2 + 1.0.0 diff --git a/pom.xml b/pom.xml index 143cbc649b1..9beb6963034 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.tensorflow tensorflow-java - 1.0.0-rc.2 + 1.0.0 pom TensorFlow Java Parent diff --git a/tensorflow-core/pom.xml b/tensorflow-core/pom.xml index 13590301650..26ed6786798 100644 --- a/tensorflow-core/pom.xml +++ b/tensorflow-core/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-java - 1.0.0-rc.2 + 1.0.0 tensorflow-core pom diff --git a/tensorflow-core/tensorflow-core-api/pom.xml b/tensorflow-core/tensorflow-core-api/pom.xml index 24b47ee26df..1f1303aa03a 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 - 1.0.0-rc.2 + 1.0.0 tensorflow-core-api jar diff --git a/tensorflow-core/tensorflow-core-generator/pom.xml b/tensorflow-core/tensorflow-core-generator/pom.xml index 4b6eefa129f..312d06a8791 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 - 1.0.0-rc.2 + 1.0.0 tensorflow-core-generator jar diff --git a/tensorflow-core/tensorflow-core-native/pom.xml b/tensorflow-core/tensorflow-core-native/pom.xml index 7190266d00e..691d1db003f 100644 --- a/tensorflow-core/tensorflow-core-native/pom.xml +++ b/tensorflow-core/tensorflow-core-native/pom.xml @@ -6,7 +6,7 @@ org.tensorflow tensorflow-core - 1.0.0-rc.2 + 1.0.0 tensorflow-core-native jar diff --git a/tensorflow-core/tensorflow-core-platform/pom.xml b/tensorflow-core/tensorflow-core-platform/pom.xml index 4b900016698..86eac891e45 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 - 1.0.0-rc.2 + 1.0.0 tensorflow-core-platform TensorFlow API Platform diff --git a/tensorflow-framework/pom.xml b/tensorflow-framework/pom.xml index 7a0cf2f7bf2..6342849b265 100644 --- a/tensorflow-framework/pom.xml +++ b/tensorflow-framework/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-java - 1.0.0-rc.2 + 1.0.0 tensorflow-framework jar