From 25c6312595fca01089ffd6efdd114951e7201030 Mon Sep 17 00:00:00 2001 From: Sean Morgan Date: Thu, 18 Apr 2024 19:31:00 -0700 Subject: [PATCH 01/11] Build against TF2.16 --- .github/workflows/release.yml | 32 ++++++++++++++-------- CONTRIBUTING.md | 10 +++---- WORKSPACE | 6 ++-- tensorflow_addons/utils/resource_loader.py | 4 +-- tensorflow_addons/version.py | 4 +-- tools/build_dev_container.sh | 2 +- tools/docker/cpu_tests.Dockerfile | 2 +- tools/install_deps/tensorflow-cpu.txt | 2 +- tools/install_deps/tensorflow.txt | 2 +- tools/run_gpu_tests.sh | 2 +- 10 files changed, 37 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 618486d232..a6de7d9eee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ permissions: env: MIN_PY_VERSION: '3.9' - MAX_PY_VERSION: '3.11' + MAX_PY_VERSION: '3.12' jobs: test-with-bazel: @@ -46,22 +46,26 @@ jobs: os: ['macos-12', 'ubuntu-20.04'] # Removing windows builds due to broken upstream package https://github.com/tensorflow/tensorflow/issues/61830 # os: ['macos-12', 'windows-2019', 'ubuntu-20.04'] - py-version: ['3.9', '3.10', '3.11'] - tf-version: ['2.13.1', '2.14.0', '2.15.0'] + py-version: ['3.9', '3.10', '3.11', '3.12'] + tf-version: ['2.14.1', '2.15.1', '2.16.1'] cpu: ['x86'] include: - os: 'macos-12' cpu: 'arm64' - tf-version: '2.15.0' + tf-version: '2.16.1' py-version: '3.9' - os: 'macos-12' cpu: 'arm64' - tf-version: '2.15.0' + tf-version: '2.16.1' py-version: '3.10' - os: 'macos-12' cpu: 'arm64' - tf-version: '2.15.0' + tf-version: '2.16.1' py-version: '3.11' + - os: 'macos-12' + cpu: 'arm64' + tf-version: '2.16.1' + py-version: '3.12' fail-fast: false steps: - uses: actions/github-script@0.3.0 @@ -71,7 +75,7 @@ jobs: script: | const commit_details = await github.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha}); return commit_details.data.author.date - - if: matrix.tf-version != '2.15.0' + - if: matrix.tf-version != '2.16.1' shell: bash run: echo "SKIP_CUSTOM_OP_TESTS=--skip-custom-ops" >> $GITHUB_ENV - if: github.event_name == 'push' @@ -107,22 +111,26 @@ jobs: os: ['macOS', 'Linux'] # Removing windows builds due to broken upstream package https://github.com/tensorflow/tensorflow/issues/61830 # os: ['macOS', 'Windows', 'Linux'] - py-version: ['3.9', '3.10', '3.11'] - tf-version: ['2.15.0'] + py-version: ['3.9', '3.10', '3.11', '3.12'] + tf-version: ['2.16.1'] cpu: ['x86'] include: - os: 'macOS' cpu: 'arm64' - tf-version: '2.15.0' + tf-version: '2.16.1' py-version: '3.9' - os: 'macOS' cpu: 'arm64' - tf-version: '2.15.0' + tf-version: '2.16.1' py-version: '3.10' - os: 'macOS' cpu: 'arm64' - tf-version: '2.15.0' + tf-version: '2.16.1' py-version: '3.11' + - os: 'macOS' + cpu: 'arm64' + tf-version: '2.16.1' + py-version: '3.12' fail-fast: false if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' steps: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f7c746a9d..461fae026d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -173,8 +173,8 @@ conda activate my_dev_environement Just run from the root: ```bash -pip install tensorflow==2.15.0 -# you can use "pip install tensorflow-cpu==2.15.0" too if you're not testing on gpu. +pip install tensorflow==2.16.1 +# you can use "pip install tensorflow-cpu==2.16.1" too if you're not testing on gpu. pip install -e ./ ``` @@ -262,7 +262,7 @@ If you need a custom C++/Cuda op for your test, compile your ops with ```bash python configure.py -pip install tensorflow==2.15.0 -e ./ -r tools/install_deps/pytest.txt +pip install tensorflow==2.16.1 -e ./ -r tools/install_deps/pytest.txt bash tools/install_so_files.sh # Linux/macos/WSL2 sh tools/install_so_files.sh # PowerShell ``` @@ -290,7 +290,7 @@ docker run --gpus all --rm -it -v ${PWD}:/addons -w /addons gcr.io/tensorflow-te Configure: ```bash -python3 -m pip install tensorflow==2.15.0 +python3 -m pip install tensorflow==2.16.1 python3 ./configure.py # Links project with TensorFlow dependency ``` @@ -329,7 +329,7 @@ quickly, as Bazel has great support for caching and distributed testing. To test with Bazel: ```bash -python3 -m pip install tensorflow==2.15.0 +python3 -m pip install tensorflow==2.16.1 python3 configure.py python3 -m pip install -r tools/install_deps/pytest.txt bazel test -c opt -k \ diff --git a/WORKSPACE b/WORKSPACE index fb378c5b98..0c8a4a6f97 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -11,10 +11,10 @@ http_archive( patches = [ "//build_deps/tf_dependency:tf.patch", ], - sha256 = "9cec5acb0ecf2d47b16891f8bc5bc6fbfdffe1700bdadc0d9ebe27ea34f0c220", - strip_prefix = "tensorflow-2.15.0", + sha256 = "c729e56efc945c6df08efe5c9f5b8b89329c7c91b8f40ad2bb3e13900bd4876d", + strip_prefix = "tensorflow-2.16.1", urls = [ - "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.15.0.tar.gz", + "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.16.1.tar.gz", ], ) diff --git a/tensorflow_addons/utils/resource_loader.py b/tensorflow_addons/utils/resource_loader.py index 862ce7d824..7a67beecdc 100644 --- a/tensorflow_addons/utils/resource_loader.py +++ b/tensorflow_addons/utils/resource_loader.py @@ -20,8 +20,8 @@ import tensorflow as tf -INCLUSIVE_MIN_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.15.0" -EXCLUSIVE_MAX_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.16.0" +INCLUSIVE_MIN_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.16.0" +EXCLUSIVE_MAX_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.17.0" abi_warning_already_raised = False SKIP_CUSTOM_OPS = False diff --git a/tensorflow_addons/version.py b/tensorflow_addons/version.py index 7825d9d72b..07346a0adc 100644 --- a/tensorflow_addons/version.py +++ b/tensorflow_addons/version.py @@ -15,8 +15,8 @@ """Define TensorFlow Addons version information.""" # Required TensorFlow version [min, max) -INCLUSIVE_MIN_TF_VERSION = "2.13.0" -EXCLUSIVE_MAX_TF_VERSION = "2.16.0" +INCLUSIVE_MIN_TF_VERSION = "2.14.0" +EXCLUSIVE_MAX_TF_VERSION = "2.17.0" # We follow Semantic Versioning (https://semver.org/) _MAJOR_VERSION = "0" diff --git a/tools/build_dev_container.sh b/tools/build_dev_container.sh index 000a121fbe..d8157456db 100755 --- a/tools/build_dev_container.sh +++ b/tools/build_dev_container.sh @@ -4,7 +4,7 @@ set -x -e docker build \ -f tools/docker/dev_container.Dockerfile \ - --build-arg TF_VERSION=2.15.0 \ + --build-arg TF_VERSION=2.16.1 \ --build-arg TF_PACKAGE=tensorflow \ --build-arg PY_VERSION=$PY_VERSION \ --no-cache \ diff --git a/tools/docker/cpu_tests.Dockerfile b/tools/docker/cpu_tests.Dockerfile index 788e91d492..df77268810 100644 --- a/tools/docker/cpu_tests.Dockerfile +++ b/tools/docker/cpu_tests.Dockerfile @@ -1,7 +1,7 @@ #syntax=docker/dockerfile:1.1.5-experimental FROM python:3.9 as build_wheel -ARG TF_VERSION=2.15.0 +ARG TF_VERSION=2.16.1 RUN pip install --default-timeout=1000 tensorflow-cpu==$TF_VERSION RUN apt-get update && apt-get install -y sudo rsync diff --git a/tools/install_deps/tensorflow-cpu.txt b/tools/install_deps/tensorflow-cpu.txt index ec368a0140..53968756bd 100644 --- a/tools/install_deps/tensorflow-cpu.txt +++ b/tools/install_deps/tensorflow-cpu.txt @@ -1 +1 @@ -tensorflow-cpu~=2.15.0 +tensorflow-cpu~=2.16.1 diff --git a/tools/install_deps/tensorflow.txt b/tools/install_deps/tensorflow.txt index ed722745f5..2917bf6b1d 100644 --- a/tools/install_deps/tensorflow.txt +++ b/tools/install_deps/tensorflow.txt @@ -1 +1 @@ -tensorflow~=2.15.0 \ No newline at end of file +tensorflow~=2.16.1 \ No newline at end of file diff --git a/tools/run_gpu_tests.sh b/tools/run_gpu_tests.sh index 214afe0e3f..8f984708fb 100644 --- a/tools/run_gpu_tests.sh +++ b/tools/run_gpu_tests.sh @@ -6,7 +6,7 @@ export DOCKER_BUILDKIT=1 docker build \ -f tools/docker/build_wheel.Dockerfile \ --target tfa_gpu_tests \ - --build-arg TF_VERSION=2.15.0 \ + --build-arg TF_VERSION=2.16.1 \ --build-arg PY_VERSION=3.9 \ -t tfa_gpu_tests ./ docker run --rm -t --gpus=all --shm-size=512m tfa_gpu_tests From 18aad6a585cc66ae5c5251605e4c868a682d5387 Mon Sep 17 00:00:00 2001 From: bhack Date: Sat, 11 May 2024 12:42:42 +0200 Subject: [PATCH 02/11] Try to use TF IO recent solution --- WORKSPACE | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 0c8a4a6f97..5baae6b148 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,8 +8,10 @@ tf_configure( http_archive( name = "org_tensorflow", - patches = [ - "//build_deps/tf_dependency:tf.patch", + patch_cmds = [ + """sed -i.bak 's/cython-3.0.3/cython-3.0.0a11/g' tensorflow/workspace2.bzl""", + """sed -i.bak 's/3.0.3.tar.gz/3.0.0a11.tar.gz/g' tensorflow/workspace2.bzl""", + """sed -i.bak 's/0c2eae8a4ceab7955be1e11a4ddc5dcc3aa06ce22ad594262f1555b9d10667f0/08dbdb6aa003f03e65879de8f899f87c8c718cd874a31ae9c29f8726da2f5ab0/g' tensorflow/workspace2.bzl""", ], sha256 = "c729e56efc945c6df08efe5c9f5b8b89329c7c91b8f40ad2bb3e13900bd4876d", strip_prefix = "tensorflow-2.16.1", From 9438b430e7ce725d527295c35cfefc36fca596b0 Mon Sep 17 00:00:00 2001 From: bhack Date: Sat, 11 May 2024 12:47:38 +0200 Subject: [PATCH 03/11] Update WORKSPACE --- WORKSPACE | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index 5baae6b148..e6e83a8342 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -20,6 +20,29 @@ http_archive( ], ) +http_archive( + name = "rules_python", + sha256 = "84aec9e21cc56fbc7f1335035a71c850d1b9b5cc6ff497306f84cced9a769841", + strip_prefix = "rules_python-0.23.1", + url = "https://github.com/bazelbuild/rules_python/releases/download/0.23.1/rules_python-0.23.1.tar.gz", +) + +load("@rules_python//python:repositories.bzl", "python_register_toolchains") +load( + "@org_tensorflow//tensorflow/tools/toolchains/python:python_repo.bzl", + "python_repository", +) + +python_repository(name = "python_version_repo") + +load("@python_version_repo//:py_version.bzl", "HERMETIC_PYTHON_VERSION") + +python_register_toolchains( + name = "python", + ignore_root_user_error = True, + python_version = HERMETIC_PYTHON_VERSION, +) + load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3") tf_workspace3() From 4a735213dafa8c679d4318a2e6274e148941cd87 Mon Sep 17 00:00:00 2001 From: bhack Date: Sat, 11 May 2024 12:52:00 +0200 Subject: [PATCH 04/11] Limit python 3.12 to TF 2.16 --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a6de7d9eee..de92d9e828 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,6 +50,8 @@ jobs: tf-version: ['2.14.1', '2.15.1', '2.16.1'] cpu: ['x86'] include: + - py-version: '3.12' + tf-version: '2.16.1' - os: 'macos-12' cpu: 'arm64' tf-version: '2.16.1' @@ -115,6 +117,8 @@ jobs: tf-version: ['2.16.1'] cpu: ['x86'] include: + - py-version: '3.12' + tf-version: '2.16.1' - os: 'macOS' cpu: 'arm64' tf-version: '2.16.1' From 0f7f5e379afeefc2d576e9b45936974658e00936 Mon Sep 17 00:00:00 2001 From: bhack Date: Sat, 11 May 2024 12:55:45 +0200 Subject: [PATCH 05/11] Update release.yml --- .github/workflows/release.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de92d9e828..a32a980c8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,22 +52,6 @@ jobs: include: - py-version: '3.12' tf-version: '2.16.1' - - os: 'macos-12' - cpu: 'arm64' - tf-version: '2.16.1' - py-version: '3.9' - - os: 'macos-12' - cpu: 'arm64' - tf-version: '2.16.1' - py-version: '3.10' - - os: 'macos-12' - cpu: 'arm64' - tf-version: '2.16.1' - py-version: '3.11' - - os: 'macos-12' - cpu: 'arm64' - tf-version: '2.16.1' - py-version: '3.12' fail-fast: false steps: - uses: actions/github-script@0.3.0 @@ -119,22 +103,6 @@ jobs: include: - py-version: '3.12' tf-version: '2.16.1' - - os: 'macOS' - cpu: 'arm64' - tf-version: '2.16.1' - py-version: '3.9' - - os: 'macOS' - cpu: 'arm64' - tf-version: '2.16.1' - py-version: '3.10' - - os: 'macOS' - cpu: 'arm64' - tf-version: '2.16.1' - py-version: '3.11' - - os: 'macOS' - cpu: 'arm64' - tf-version: '2.16.1' - py-version: '3.12' fail-fast: false if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' steps: From 9ce4d07f88b60246776b0c5a59212b04234e0867 Mon Sep 17 00:00:00 2001 From: bhack Date: Sat, 11 May 2024 13:03:09 +0200 Subject: [PATCH 06/11] Update release.yml --- .github/workflows/release.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a32a980c8d..afb3d831e1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,6 +52,11 @@ jobs: include: - py-version: '3.12' tf-version: '2.16.1' + exclude: + - py-version: '3.12' + tf-version: '2.14.1' + - py-version: '3.12' + tf-version: '2.15.1' fail-fast: false steps: - uses: actions/github-script@0.3.0 @@ -103,6 +108,11 @@ jobs: include: - py-version: '3.12' tf-version: '2.16.1' + exclude: + - py-version: '3.12' + tf-version: '2.14.1' + - py-version: '3.12' + tf-version: '2.15.1' fail-fast: false if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' steps: From 2240185322c0e590c99bef56fc84d588c676ca63 Mon Sep 17 00:00:00 2001 From: bhack Date: Sat, 11 May 2024 13:07:10 +0200 Subject: [PATCH 07/11] Update release.yml --- .github/workflows/release.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afb3d831e1..fab0546baf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,9 +49,6 @@ jobs: py-version: ['3.9', '3.10', '3.11', '3.12'] tf-version: ['2.14.1', '2.15.1', '2.16.1'] cpu: ['x86'] - include: - - py-version: '3.12' - tf-version: '2.16.1' exclude: - py-version: '3.12' tf-version: '2.14.1' @@ -105,9 +102,6 @@ jobs: py-version: ['3.9', '3.10', '3.11', '3.12'] tf-version: ['2.16.1'] cpu: ['x86'] - include: - - py-version: '3.12' - tf-version: '2.16.1' exclude: - py-version: '3.12' tf-version: '2.14.1' From 945be7752fa73678afff662a4d3edc0274f6ba22 Mon Sep 17 00:00:00 2001 From: bhack Date: Sat, 11 May 2024 13:09:03 +0200 Subject: [PATCH 08/11] Update release.yml --- .github/workflows/release.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fab0546baf..7baf2202e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,6 +49,11 @@ jobs: py-version: ['3.9', '3.10', '3.11', '3.12'] tf-version: ['2.14.1', '2.15.1', '2.16.1'] cpu: ['x86'] + include: + - os: 'macos-12' + cpu: 'arm64' + py-version: 3.12 + tf-version: '2.16.1' exclude: - py-version: '3.12' tf-version: '2.14.1' @@ -102,6 +107,11 @@ jobs: py-version: ['3.9', '3.10', '3.11', '3.12'] tf-version: ['2.16.1'] cpu: ['x86'] + include: + - os: 'macos-12' + cpu: 'arm64' + py-version: 3.12 + tf-version: '2.16.1' exclude: - py-version: '3.12' tf-version: '2.14.1' From 6115751bf92dbba858f3121c541a7903e123b2aa Mon Sep 17 00:00:00 2001 From: bhack Date: Sat, 11 May 2024 13:12:06 +0200 Subject: [PATCH 09/11] Update build_wheel.Dockerfile --- tools/docker/build_wheel.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker/build_wheel.Dockerfile b/tools/docker/build_wheel.Dockerfile index 9542e1365a..ef64befbd2 100644 --- a/tools/docker/build_wheel.Dockerfile +++ b/tools/docker/build_wheel.Dockerfile @@ -1,6 +1,6 @@ #syntax=docker/dockerfile:1.1.5-experimental ARG PY_VERSION -FROM tensorflow/build:2.15-python$PY_VERSION as base_install +FROM tensorflow/build:2.16-python$PY_VERSION as base_install ENV TF_NEED_CUDA="1" ARG PY_VERSION From 93516cdc26ce39bb39336b44c45987693bac0590 Mon Sep 17 00:00:00 2001 From: bhack Date: Sat, 11 May 2024 13:29:08 +0200 Subject: [PATCH 10/11] Update build_wheel.Dockerfile --- tools/docker/build_wheel.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker/build_wheel.Dockerfile b/tools/docker/build_wheel.Dockerfile index ef64befbd2..cf0773ac46 100644 --- a/tools/docker/build_wheel.Dockerfile +++ b/tools/docker/build_wheel.Dockerfile @@ -7,7 +7,7 @@ ARG PY_VERSION ARG TF_VERSION # TODO: Temporary due to build bug https://github.com/pypa/pip/issues/11770 -RUN python -m pip install pip==22.3.1 +RUN python -m pip install --upgrade pip==22.3.1 setuptools # TODO: Remove this if tensorflow/build container removes their keras-nightly install # https://github.com/tensorflow/build/issues/78 From 99f6f85e0900e19a7c393f1909d5a03bef4660d6 Mon Sep 17 00:00:00 2001 From: bhack Date: Sat, 11 May 2024 13:34:02 +0200 Subject: [PATCH 11/11] Update build_wheel.Dockerfile --- tools/docker/build_wheel.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker/build_wheel.Dockerfile b/tools/docker/build_wheel.Dockerfile index cf0773ac46..e4c5d37f38 100644 --- a/tools/docker/build_wheel.Dockerfile +++ b/tools/docker/build_wheel.Dockerfile @@ -7,7 +7,7 @@ ARG PY_VERSION ARG TF_VERSION # TODO: Temporary due to build bug https://github.com/pypa/pip/issues/11770 -RUN python -m pip install --upgrade pip==22.3.1 setuptools +RUN python -m pip install --upgrade setuptools # TODO: Remove this if tensorflow/build container removes their keras-nightly install # https://github.com/tensorflow/build/issues/78