diff --git a/.bazeliskrc b/.bazeliskrc index 72fbf2d2e2..4331f3e1d3 100644 --- a/.bazeliskrc +++ b/.bazeliskrc @@ -1 +1 @@ -USE_BAZEL_VERSION=5.3.0 +USE_BAZEL_VERSION=6.1.0 diff --git a/.github/workflows/make_wheel_Linux_x86.sh b/.github/workflows/make_wheel_Linux_x86.sh index c76289c9eb..0826adfab3 100644 --- a/.github/workflows/make_wheel_Linux_x86.sh +++ b/.github/workflows/make_wheel_Linux_x86.sh @@ -2,8 +2,12 @@ set -e -x df -h docker info + # to get more disk space -rm -rf /usr/share/dotnet & +rm -rf "$AGENT_TOOLSDIRECTORY" & +rm -rf /opt/ghc & +rm -rf "/usr/local/share/boost" & +rm -rf /usr/share/dotnet # Tests are ran as part of make_wheel target DOCKER_BUILDKIT=1 docker build \ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3388370231..1c2a118518 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,25 +44,21 @@ jobs: # To switch on windows-2022/latest, please verify the bazel version: # https://github.com/bazelbuild/bazel/issues/14232#issuecomment-1011247429 os: ['macos-12', 'windows-2019', 'ubuntu-20.04'] - py-version: ['3.8', '3.9', '3.10', '3.11'] - tf-version: ['2.11.1', '2.12.0', '2.13.0'] + py-version: ['3.9', '3.10', '3.11'] + tf-version: ['2.12.1', '2.13.0', '2.14.0'] cpu: ['x86'] include: - os: 'macos-12' cpu: 'arm64' - tf-version: '2.13.0' - py-version: '3.8' - - os: 'macos-12' - cpu: 'arm64' - tf-version: '2.13.0' + tf-version: '2.14.0' py-version: '3.9' - os: 'macos-12' cpu: 'arm64' - tf-version: '2.13.0' + tf-version: '2.14.0' py-version: '3.10' - os: 'macos-12' cpu: 'arm64' - tf-version: '2.13.0' + tf-version: '2.14.0' py-version: '3.11' fail-fast: false steps: @@ -73,7 +69,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.13.0' + - if: matrix.tf-version != '2.14.0' shell: bash run: echo "SKIP_CUSTOM_OP_TESTS=--skip-custom-ops" >> $GITHUB_ENV - if: github.event_name == 'push' @@ -87,8 +83,7 @@ jobs: name: Setup Bazel # Ubuntu bazel is run inside of the docker image run: bash tools/install_deps/install_bazelisk.sh ./ - - if: matrix.py-version != '3.11' || matrix.tf-version == '2.12.0' || matrix.tf-version == '2.13.0' - name: Build wheels + - name: Build wheels env: OS: ${{ runner.os }} PY_VERSION: ${{ matrix.py-version }} @@ -97,8 +92,7 @@ jobs: CPU: ${{ matrix.cpu }} shell: bash run: bash .github/workflows/make_wheel_${OS}_${CPU}.sh - - if: matrix.py-version != '3.11' || matrix.tf-version == '2.12.0' || matrix.tf-version == '2.13.0' - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v1 with: name: ${{ runner.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-${{ matrix.cpu }}-wheel path: wheelhouse @@ -109,25 +103,21 @@ jobs: strategy: matrix: os: ['macOS', 'Windows', 'Linux'] - py-version: ['3.8', '3.9', '3.10', '3.11'] - tf-version: ['2.13.0'] + py-version: ['3.9', '3.10', '3.11'] + tf-version: ['2.14.0'] cpu: ['x86'] include: - os: 'macOS' cpu: 'arm64' - tf-version: '2.13.0' - py-version: '3.8' - - os: 'macOS' - cpu: 'arm64' - tf-version: '2.13.0' + tf-version: '2.14.0' py-version: '3.9' - os: 'macOS' cpu: 'arm64' - tf-version: '2.13.0' + tf-version: '2.14.0' py-version: '3.10' - os: 'macOS' cpu: 'arm64' - tf-version: '2.13.0' + tf-version: '2.14.0' py-version: '3.11' fail-fast: false if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 175e5983b5..81e0f3a548 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.13.0 -# you can use "pip install tensorflow-cpu==2.13.0" too if you're not testing on gpu. +pip install tensorflow==2.14.0 +# you can use "pip install tensorflow-cpu==2.14.0" 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.13.0 -e ./ -r tools/install_deps/pytest.txt +pip install tensorflow==2.14.0 -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.13.0 +python3 -m pip install tensorflow==2.14.0 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.13.0 +python3 -m pip install tensorflow==2.14.0 python3 configure.py python3 -m pip install -r tools/install_deps/pytest.txt bazel test -c opt -k \ diff --git a/requirements.txt b/requirements.txt index 70463d6e32..d060a4762e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ typeguard>=2.7,<3.0.0 -packaging \ No newline at end of file +packaging diff --git a/setup.py b/setup.py index d3aac99fa4..70e89bdb65 100644 --- a/setup.py +++ b/setup.py @@ -115,7 +115,6 @@ def has_ext_modules(self): "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", diff --git a/tensorflow_addons/activations/gelu.py b/tensorflow_addons/activations/gelu.py index 45dc2e1962..9c4dc07e09 100644 --- a/tensorflow_addons/activations/gelu.py +++ b/tensorflow_addons/activations/gelu.py @@ -51,11 +51,11 @@ def gelu(x: TensorLike, approximate: bool = True) -> tf.Tensor: Usage: - >>> x = tf.constant([-1.0, 0.0, 1.0]) + >>> x = tf.constant([0.0, 0.0, 1.0]) >>> tfa.activations.gelu(x, approximate=False) - + >>> tfa.activations.gelu(x, approximate=True) - + Args: x: A `Tensor`. Must be one of the following types: diff --git a/tensorflow_addons/metrics/tests/streaming_correlations_test.py b/tensorflow_addons/metrics/tests/streaming_correlations_test.py index 6e9564e91f..ce99c69a25 100644 --- a/tensorflow_addons/metrics/tests/streaming_correlations_test.py +++ b/tensorflow_addons/metrics/tests/streaming_correlations_test.py @@ -123,7 +123,7 @@ def test_keras_binary_classification_model(self, correlation_type): metric.reset_state() # we decorate with tf.function to ensure the metric is also checked against graph mode. # keras automatically decorates the metrics compiled within keras.Model. - tf.function(metric.update_state)(y, preds) + metric.update_state(y, preds) metric_value = tf.function(metric.result)() scipy_value = self.scipy_corr[correlation_type](preds[:, 0], y[:, 0])[0] np.testing.assert_almost_equal(metric_value, metric_history[-1], decimal=6) diff --git a/tensorflow_addons/utils/resource_loader.py b/tensorflow_addons/utils/resource_loader.py index 609b3f4d9f..e4c737247a 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.13.0" -EXCLUSIVE_MAX_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.14.0" +INCLUSIVE_MIN_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.14.0" +EXCLUSIVE_MAX_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.15.0" abi_warning_already_raised = False SKIP_CUSTOM_OPS = False diff --git a/tensorflow_addons/version.py b/tensorflow_addons/version.py index abf760e251..3d5c9771d6 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.11.0" -EXCLUSIVE_MAX_TF_VERSION = "2.14.0" +INCLUSIVE_MIN_TF_VERSION = "2.12.0" +EXCLUSIVE_MAX_TF_VERSION = "2.15.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 0720fc3dbc..c2c5574162 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.13.0 \ + --build-arg TF_VERSION=2.14.0 \ --build-arg TF_PACKAGE=tensorflow \ --build-arg PY_VERSION=$PY_VERSION \ --no-cache \ diff --git a/tools/docker/build_wheel.Dockerfile b/tools/docker/build_wheel.Dockerfile index 18c8757610..73c03e05fb 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.13-python$PY_VERSION as base_install +FROM tensorflow/build:2.14-python$PY_VERSION as base_install ENV TF_NEED_CUDA="1" ARG PY_VERSION diff --git a/tools/docker/cpu_tests.Dockerfile b/tools/docker/cpu_tests.Dockerfile index 98f9001851..82783514b1 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.13.0 +ARG TF_VERSION=2.14.0 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/install_bazelisk.sh b/tools/install_deps/install_bazelisk.sh index 6305798a2a..57c94cacc4 100644 --- a/tools/install_deps/install_bazelisk.sh +++ b/tools/install_deps/install_bazelisk.sh @@ -10,7 +10,7 @@ case "$(uname -s)" in esac mkdir -p "${output_dir}" -curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.3.0/${name}" +curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/${name}" mv "${name}" "${output_dir}/bazel" chmod u+x "${output_dir}/bazel" diff --git a/tools/install_deps/tensorflow-cpu.txt b/tools/install_deps/tensorflow-cpu.txt index e1020c15f1..181c612983 100644 --- a/tools/install_deps/tensorflow-cpu.txt +++ b/tools/install_deps/tensorflow-cpu.txt @@ -1 +1 @@ -tensorflow-cpu~=2.13.0 +tensorflow-cpu~=2.14.0 diff --git a/tools/install_deps/tensorflow.txt b/tools/install_deps/tensorflow.txt index c3a69761cb..c85301a95c 100644 --- a/tools/install_deps/tensorflow.txt +++ b/tools/install_deps/tensorflow.txt @@ -1 +1 @@ -tensorflow~=2.13.0 \ No newline at end of file +tensorflow~=2.14.0 \ No newline at end of file diff --git a/tools/run_gpu_tests.sh b/tools/run_gpu_tests.sh index 14d5ec0a34..2651c5bfbc 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.13.0 \ + --build-arg TF_VERSION=2.14.0 \ --build-arg PY_VERSION=3.9 \ -t tfa_gpu_tests ./ docker run --rm -t --gpus=all --shm-size=512m tfa_gpu_tests