Skip to content

Commit 76640d1

Browse files
Upgrade to TF 2.18.0 (#608)
--------- Co-authored-by: Karl Lessard <[email protected]>
1 parent f70190b commit 76640d1

File tree

843 files changed

+11466
-3471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

843 files changed

+11466
-3471
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
jobs:
1818
check-format:
1919
if: github.event_name == 'pull_request'
20-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-22.04
2121
steps:
2222
- name: Configure Java
2323
uses: actions/setup-java@v2
@@ -35,7 +35,7 @@ jobs:
3535
run: |
3636
mvn spotless:check -Pjdk17 -B -U -e
3737
prepare:
38-
runs-on: ubuntu-20.04
38+
runs-on: ubuntu-22.04
3939
outputs:
4040
repositoryUrl: ${{ steps.repository.outputs.repositoryUrl }}
4141
steps:
@@ -91,7 +91,7 @@ jobs:
9191
if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
9292
run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }}
9393
linux-x86_64:
94-
runs-on: ubuntu-20.04
94+
runs-on: ubuntu-22.04
9595
needs: prepare
9696
strategy:
9797
matrix:
@@ -137,29 +137,6 @@ jobs:
137137
- name: Deploy native artifact
138138
if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
139139
run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }}
140-
macosx-x86_64:
141-
runs-on: macos-13
142-
needs: prepare
143-
strategy:
144-
matrix:
145-
ext: [""]
146-
steps:
147-
- name: Configure Java
148-
uses: actions/setup-java@v2
149-
with:
150-
distribution: 'adopt'
151-
java-version: '11'
152-
- name: Checkout repository
153-
uses: actions/checkout@v1
154-
- name: Build project
155-
run: |
156-
clang --version
157-
mvn -version
158-
echo "<settings><servers><server><id>ossrh</id><username>${{ secrets.CI_DEPLOY_USERNAME }}</username><password>${{ secrets.CI_DEPLOY_PASSWORD }}</password></server></servers></settings>" > $HOME/.m2/settings.xml
159-
mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }}
160-
- name: Deploy native artifact
161-
if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true'
162-
run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }}
163140
windows-x86_64:
164141
runs-on: windows-2019
165142
needs: prepare
@@ -208,8 +185,8 @@ jobs:
208185
if ERRORLEVEL 1 exit /b
209186
deploy:
210187
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging') }} # DEPLOY_SNAPSHOT (releases should be signed and deployed manually from local machine)
211-
needs: [linux-x86_64, macosx-x86_64, windows-x86_64, macosx-arm64, linux-arm64]
212-
runs-on: ubuntu-20.04
188+
needs: [linux-x86_64, windows-x86_64, macosx-arm64, linux-arm64]
189+
runs-on: ubuntu-22.04
213190
steps:
214191
- name: Configure Java
215192
uses: actions/setup-java@v2

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ To upgrade the version of TensorFlow that is embedded within TensorFlow Java, pl
8282
3. Update `urls`, `sha256` and `strip_prefix` fields of the `org_tensorflow` archive rule in Bazel [workspace](https://github.com/tensorflow/java/blob/master/tensorflow-core/tensorflow-core-native/WORKSPACE#L19)
8383
4. Extract the archive in a temporary folder
8484
5. Copy the content of `tensorflow-x.x.x/.bazelrc` file to `tensorflow-core/tensorflow-core-native/tensorflow.bazelrc` under TensorFlow Java source tree
85-
6. Copy the content of `tensorflow-x.x.x/WORKSPACE` after the "###### Copy content of..." notice if `tensorflow-core/tensorflow-core-native/WORKSPACE`, read notice for more details
85+
6. Copy the content of `tensorflow-x.x.x/WORKSPACE` after the "###### Copy content of..." notice to `tensorflow-core/tensorflow-core-native/WORKSPACE`, read notice for more details
8686
7. Copy the content of `tensorflow-x.x.x/.bazelversion` file to `tensorflow-core/tensorflow-core-native/.bazelversion`
8787
8. Validate that options in `tensorflow-core/tensorflow-core-native/.bazelrc` are still accurate or update them accordingly
8888
9. Update URLs of existing TensorFlow binaries in the `tensorflow-core/tensorflow-core-native/scripts/dist_download` script

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,24 @@ only binaries for the followings are being **supported and distributed** by this
5959
- `linux-x86_64`: Linux platforms on Intel/AMD chips
6060
- `linux-x86_64-gpu`: Linux platforms on Intel/AMD chips with Cuda GPU support
6161
- `linux-arm64`: Linux platforms on Arm chips
62-
- `macosx-x86_64`: MacOS X platforms on Intel/AMD chips
6362
- `macosx-arm64`: MacOS X platforms on Apple Silicon chips
6463
- `windows-x86_64`: Windows platforms on Intel/AMD chips
6564

65+
Binaries for `macosx-x86_64` are available for TF-Java 1.0 series releases and earlier, they were dropped from
66+
TF-Java 1.1 and newer as they are no longer supported or released by Google.
67+
6668
For example, for building a JAR that uses TensorFlow and is targeted to be deployed only on Linux
6769
systems with no GPU support, you should add the following dependencies:
6870
```xml
6971
<dependency>
7072
<groupId>org.tensorflow</groupId>
7173
<artifactId>tensorflow-core-api</artifactId>
72-
<version>1.0.0-rc.2</version>
74+
<version>1.0.0</version>
7375
</dependency>
7476
<dependency>
7577
<groupId>org.tensorflow</groupId>
7678
<artifactId>tensorflow-core-native</artifactId>
77-
<version>1.0.0-rc.2</version>
79+
<version>1.0.0</version>
7880
<classifier>linux-x86_64</classifier>
7981
</dependency>
8082
```
@@ -85,24 +87,24 @@ native dependencies as follows:
8587
<dependency>
8688
<groupId>org.tensorflow</groupId>
8789
<artifactId>tensorflow-core-api</artifactId>
88-
<version>1.0.0-rc.2</version>
90+
<version>1.0.0</version>
8991
</dependency>
9092
<dependency>
9193
<groupId>org.tensorflow</groupId>
9294
<artifactId>tensorflow-core-native</artifactId>
93-
<version>1.0.0-rc.2</version>
95+
<version>1.0.0</version>
9496
<classifier>linux-x86_64-gpu</classifier>
9597
</dependency>
9698
<dependency>
9799
<groupId>org.tensorflow</groupId>
98100
<artifactId>tensorflow-core-native</artifactId>
99-
<version>1.0.0-rc.2</version>
101+
<version>1.0.0</version>
100102
<classifier>macosx-arm64</classifier>
101103
</dependency>
102104
<dependency>
103105
<groupId>org.tensorflow</groupId>
104106
<artifactId>tensorflow-core-native</artifactId>
105-
<version>1.0.0-rc.2</version>
107+
<version>1.0.0</version>
106108
<classifier>windows-x86_64</classifier>
107109
</dependency>
108110
```
@@ -119,15 +121,15 @@ For Ubuntu 24.04, you can install them with the following command:
119121
In some cases, it might be preferable to add a single dependency that includes transitively all the artifacts
120122
required to run TensorFlow Java on any [supported platforms](README.md#individual-dependencies)
121123

122-
- `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`
124+
- `tensorflow-core-platform`: Includes `tensorflow-core-api`, plus native artifacts for `linux-x86_64`, `linux-x86_64-arm64`, `macosx-arm64` and `windows-x86_64`
123125

124126
For example, to run TensorFlow Java on any CPU platform for which a binary is being distributed by this project, you can
125127
simply add this dependency to your application:
126128
```xml
127129
<dependency>
128130
<groupId>org.tensorflow</groupId>
129131
<artifactId>tensorflow-core-platform</artifactId>
130-
<version>1.0.0-rc.2</version>
132+
<version>1.0.0</version>
131133
</dependency>
132134
```
133135

@@ -157,7 +159,7 @@ to add Sonatype OSS repository in your pom.xml, like the following
157159
<dependency>
158160
<groupId>org.tensorflow</groupId>
159161
<artifactId>tensorflow-core-platform</artifactId>
160-
<version>1.0.0-SNAPSHOT</version>
162+
<version>1.1.0-SNAPSHOT</version>
161163
</dependency>
162164
</dependencies>
163165
```
@@ -179,7 +181,8 @@ This table shows the mapping between TensorFlow, TensorFlow Java and minimum sup
179181
| 0.5.0 | 2.10.1 | 11 |
180182
| 1.0.0-rc.1 | 2.16.1 | 11 |
181183
| 1.0.0-rc.2 | 2.16.2 | 11 |
182-
| 1.0.0-SNAPSHOT | 2.16.2 | 11 |
184+
| 1.0.0 | 2.16.2 | 11 |
185+
| 1.1.0-SNAPSHOT | 2.18.0 | 11 |
183186

184187
## How to Contribute?
185188

docs/install.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ following platforms:
1818

1919
* Ubuntu 20.04 or higher; 64-bit, x86
2020
* Ubuntu 22.04 or higher; 64-bit, arm
21-
* macOS 12 or higher; 64-bit, x86
2221
* macOS 14 or higher; 64-bit, arm
2322
* Windows 10 or higher; 64-bit, x86
2423

24+
TensorFlow Java 1.0 series and earlier releases also have binaries for:
25+
26+
* macOS 12 or higher; 64-bit, x86
27+
2528
*Note: To use TensorFlow on Android, see
2629
[TensorFlow Lite](https://tensorflow.org/lite)*
2730

@@ -59,7 +62,7 @@ For example,
5962
<dependency>
6063
<groupId>org.tensorflow</groupId>
6164
<artifactId>tensorflow-core-platform</artifactId>
62-
<version>1.0.0-rc.2</version>
65+
<version>1.0.0</version>
6366
</dependency>
6467
```
6568

@@ -102,7 +105,7 @@ snapshots repository in your `pom.xml`.
102105
<dependency>
103106
<groupId>org.tensorflow</groupId>
104107
<artifactId>tensorflow-core-platform</artifactId>
105-
<version>1.0.0-SNAPSHOT</version>
108+
<version>1.1.0-SNAPSHOT</version>
106109
</dependency>
107110
</dependencies>
108111
```
@@ -119,7 +122,7 @@ repositories {
119122
}
120123
121124
dependencies {
122-
compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '1.0.0-rc.2'
125+
compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '1.0.0'
123126
}
124127
```
125128

@@ -165,7 +168,7 @@ add the TensorFlow dependency to the project's `pom.xml` file:
165168
<dependency>
166169
<groupId>org.tensorflow</groupId>
167170
<artifactId>tensorflow-core-platform</artifactId>
168-
<version>1.0.0-rc.2</version>
171+
<version>1.0.0</version>
169172
</dependency>
170173
</dependencies>
171174
</project>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>org.tensorflow</groupId>
99
<artifactId>tensorflow-java</artifactId>
10-
<version>1.0.0-SNAPSHOT</version>
10+
<version>1.1.0-SNAPSHOT</version>
1111
<packaging>pom</packaging>
1212

1313
<name>TensorFlow Java Parent</name>
@@ -212,7 +212,7 @@
212212
<!--arg>-Werror</arg--> <!-- Disabled (temporarily?) -->
213213
<arg>-Xlint:all</arg>
214214
<arg>-XDcompilePolicy=simple</arg>
215-
<arg>-Xplugin:ErrorProne</arg>
215+
<!-- FIXME: turn me on again! arg>-Xplugin:ErrorProne</arg-->
216216
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
217217
<arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
218218

tensorflow-core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.tensorflow</groupId>
2424
<artifactId>tensorflow-java</artifactId>
25-
<version>1.0.0-SNAPSHOT</version>
25+
<version>1.1.0-SNAPSHOT</version>
2626
</parent>
2727
<artifactId>tensorflow-core</artifactId>
2828
<packaging>pom</packaging>
@@ -59,7 +59,7 @@
5959
<javacpp.platform.macosx-arm64.extension>macosx-arm64${javacpp.platform.extension}</javacpp.platform.macosx-arm64.extension>
6060
<javacpp.platform.macosx-x86_64.extension>macosx-x86_64${javacpp.platform.extension}</javacpp.platform.macosx-x86_64.extension>
6161
<javacpp.platform.windows-x86_64.extension>windows-x86_64${javacpp.platform.extension}</javacpp.platform.windows-x86_64.extension>
62-
<javacpp.version>1.5.10</javacpp.version>
62+
<javacpp.version>1.5.11</javacpp.version>
6363
</properties>
6464

6565
<profiles>

tensorflow-core/tensorflow-core-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.tensorflow</groupId>
88
<artifactId>tensorflow-core</artifactId>
9-
<version>1.0.0-SNAPSHOT</version>
9+
<version>1.1.0-SNAPSHOT</version>
1010
</parent>
1111
<artifactId>tensorflow-core-api</artifactId>
1212
<packaging>jar</packaging>

tensorflow-core/tensorflow-core-api/scripts/test_download.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ DOWNLOAD_FOLDER="$1"
55

66
case ${PLATFORM:-} in
77
'linux-x86_64')
8-
TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/43/dd/8f03331107b76e63313d2089ddfbd13f15e51fb8ed73517cdd0ab3341928/tensorflow-2.16.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'
8+
TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/f3/73/3a906feb0d71d9353c6fb2363d4052856cc6eff5a78a097b1a6002d4e908/tensorflow_text-2.18.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'
99
;;
10-
'macosx-x86_64')
11-
TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/6d/69/9999c2d9e8a3b08dfcfc7e9259a05fb1da5f700936091d2eb4a7985c2776/tensorflow-2.16.2-cp311-cp311-macosx_10_15_x86_64.whl'
10+
'linux-arm64')
11+
TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/8a/9a/ebba9f6274f8b51e5fe1ac2411b8b6bf680a32d10bd6e9c54be1faeec062/tensorflow_text-2.18.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl'
12+
;;
13+
'macosx-arm64')
14+
TEXT_WHEEL_URL='https://files.pythonhosted.org/packages/18/b6/8ad233edb0732847db1da538cea941dcccc42f59304ff6fb449676e6dd5a/tensorflow_text-2.18.1-cp311-cp311-macosx_11_0_arm64.whl'
1215
;;
1316
*)
1417
echo "TensorFlow Text distribution for ${PLATFORM} is not supported for download"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
op {
2+
graph_op_name: "CheckPinned"
3+
endpoint {
4+
name: "CheckPinned"
5+
}
6+
}

tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataSize.pbtxt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
op {
22
graph_op_name: "ComputeDedupDataSize"
3-
visibility: VISIBLE
3+
visibility: SKIP
44
endpoint {
55
name: "tpu.ComputeDedupDataSize"
66
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
op {
2+
graph_op_name: "ComputeDedupDataSizeV2"
3+
endpoint {
4+
name: "tpu.ComputeDedupDataSize"
5+
}
6+
}

tensorflow-core/tensorflow-core-api/src/api/api_def_ComputeDedupDataTupleMask.pbtxt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
op {
2-
visibility: VISIBLE
2+
visibility: SKIP
33
graph_op_name: "ComputeDedupDataTupleMask"
44
endpoint {
55
name: "tpu.ComputeDedupDataTupleMask"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
op {
2+
graph_op_name: "ComputeDedupDataTupleMaskV2"
3+
endpoint {
4+
name: "tpu.ComputeDedupDataTupleMask"
5+
}
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
op {
2+
graph_op_name: "ConvertToListOfSparseCoreCooTensors"
3+
visibility: VISIBLE
4+
endpoint {
5+
name: "sparse.ConvertToListOfSparseCoreCooTensors"
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
op {
2+
graph_op_name: "ConvertToSparseCoreCsrWrappedCooTensor"
3+
visibility: VISIBLE
4+
endpoint {
5+
name: "sparse.ConvertToSparseCoreCsrWrappedCooTensor"
6+
}
7+
}

tensorflow-core/tensorflow-core-api/src/api/api_def_FinalizeTPUEmbedding.pbtxt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
op {
2-
visibility: VISIBLE
2+
visibility: SKIP
33
graph_op_name: "FinalizeTPUEmbedding"
44
endpoint {
55
name: "tpu.FinalizeTPUEmbedding"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
op {
2+
graph_op_name: "FinalizeTPUEmbeddingV2"
3+
endpoint {
4+
name: "tpu.FinalizeTPUEmbedding"
5+
}
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
op {
2+
graph_op_name: "GetStatsFromListOfSparseCoreCooTensors"
3+
visibility: VISIBLE
4+
endpoint {
5+
name: "sparse.GetStatsFromListOfSparseCoreCooTensors"
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
op {
2+
graph_op_name: "GetTpuTaskId"
3+
visibility: VISIBLE
4+
endpoint {
5+
name: "tpu.GetTpuTaskId"
6+
}
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
op {
2+
graph_op_name: "GlobalShuffleDataset"
3+
endpoint {
4+
name: "data.GlobalShuffleDataset"
5+
}
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
op {
2+
graph_op_name: "IndexFlatMapDataset"
3+
visibility: VISIBLE
4+
endpoint {
5+
name: "data.IndexFlatMapDataset"
6+
}
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
op {
2+
graph_op_name: "IteratorGetModelProto"
3+
endpoint {
4+
name: "data.IteratorGetModelProto"
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
op {
2+
graph_op_name: "SortListOfSparseCoreCooTensors"
3+
endpoint {
4+
name: "sparse.SortListOfSparseCoreCooTensors"
5+
}
6+
}

0 commit comments

Comments
 (0)