Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e273a69
Build against TF2.5
seanpmorgan Apr 6, 2021
d47b841
Build against TF2.5
seanpmorgan Apr 6, 2021
c2da6c3
Test setup-pythonv2
bhack Apr 8, 2021
c92ddc8
Temp limit python range
bhack Apr 9, 2021
f4cbd2a
rc1
bhack Apr 14, 2021
dfce967
Merge branch 'build-tf2.5' of github.com:seanpmorgan/addons into buil…
seanpmorgan Apr 25, 2021
fcfb295
Update version checks
seanpmorgan Apr 25, 2021
86e5007
Update CUDA in docker
seanpmorgan Apr 25, 2021
43528ca
Remove 2.3.0 + py39 tests since TF whl is not available
seanpmorgan Apr 26, 2021
281e109
Fix action
seanpmorgan Apr 28, 2021
f031ef4
rc2
seanpmorgan Apr 28, 2021
60479ca
Set 11.2 CUDA
seanpmorgan Apr 28, 2021
ffdb0de
Update build toolchain
seanpmorgan Apr 28, 2021
fbd2ee1
Temporary skip
seanpmorgan Apr 28, 2021
9909385
Update build versions
seanpmorgan Apr 28, 2021
61aec5c
Increase Pillow version since windows 3.9 is not available for v7
seanpmorgan Apr 28, 2021
70dddbf
Temporary: Install Py39
seanpmorgan Apr 28, 2021
dc1aaaf
Temporary: Install Py39
seanpmorgan Apr 28, 2021
6aa65d4
Update docs
seanpmorgan Apr 28, 2021
c636fba
Remove temp skip, add new warning for model load error
seanpmorgan Apr 28, 2021
44ed612
Sepearate pytest skip
seanpmorgan Apr 28, 2021
d9eebac
Set op name
seanpmorgan Apr 28, 2021
cf932ae
Install auditwheel
seanpmorgan Apr 28, 2021
0f04d5a
Remove python install
seanpmorgan May 4, 2021
66ef7c0
Bump to TF2.5 release
seanpmorgan May 13, 2021
cd7f8c2
Merge branch 'master' into build-tf2.5
seanpmorgan May 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ on:

env:
MIN_PY_VERSION: '3.6'
MAX_PY_VERSION: '3.8'
MAX_PY_VERSION: '3.9'

jobs:
test-with-bazel:
name: Test with bazel
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ env.MIN_PY_VERSION }}
- name: Build wheels
Expand All @@ -39,8 +39,8 @@ jobs:
strategy:
matrix:
os: ['macos-latest', 'windows-latest', 'ubuntu-18.04']
py-version: ['3.6', '3.7', '3.8']
tf-version: ['2.3.0', '2.4.1']
py-version: ['3.6', '3.7', '3.8', '3.9']
tf-version: ['2.3.0', '2.5.0']
fail-fast: false
steps:
- uses: actions/github-script@0.3.0
Expand All @@ -54,22 +54,24 @@ jobs:
shell: bash
run: echo "NIGHTLY_FLAG=--nightly" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py-version }}
- name: Setup Bazel
- if: matrix.os != 'ubuntu-18.04'
name: Setup Bazel
# Ubuntu bazel is run inside of the docker image
if: matrix.os != 'ubuntu-18.04'
run: bash tools/install_deps/install_bazelisk.sh ./
- name: Build wheels
- if: matrix.py-version != '3.9' || matrix.tf-version != '2.3.0'
name: Build wheels
env:
OS: ${{ runner.os }}
PY_VERSION: ${{ matrix.py-version }}
TF_VERSION: ${{ matrix.tf-version }}
NIGHTLY_TIME: ${{ steps.author-date.outputs.result }}
shell: bash
run: bash .github/workflows/make_wheel_${OS}.sh
- uses: actions/upload-artifact@v1
- if: matrix.py-version != '3.9' || matrix.tf-version != '2.3.0'
uses: actions/upload-artifact@v1
Comment on lines +73 to +74

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with:
name: ${{ runner.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-wheel
path: wheelhouse
Expand All @@ -80,8 +82,8 @@ jobs:
strategy:
matrix:
os: ['macOS', 'Windows', 'Linux']
py-version: ['3.6', '3.7', '3.8']
tf-version: ['2.4.1']
py-version: ['3.6', '3.7', '3.8', '3.9']
tf-version: ['2.5.0']
fail-fast: false
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release'
steps:
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ conda activate my_dev_environement
Just run from the root:

```bash
pip install tensorflow==2.4.1
# you can use "pip install tensorflow-cpu==2.4.1" too if you're not testing on gpu.
pip install tensorflow==2.5.0
# you can use "pip install tensorflow-cpu==2.5.0" too if you're not testing on gpu.
pip install -e ./
```

Expand Down Expand Up @@ -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.4.1 -e ./ -r tools/install_deps/pytest.txt
pip install tensorflow==2.5.0 -e ./ -r tools/install_deps/pytest.txt
bash tools/install_so_files.sh # Linux/macos/WSL2
sh tools/install_so_files.sh # PowerShell
```
Expand All @@ -285,12 +285,12 @@ docker run --rm -it -v ${PWD}:/addons -w /addons tfaddons/dev_container:latest-c

GPU Docker:
```bash
docker run --gpus all --rm -it -v ${PWD}:/addons -w /addons gcr.io/tensorflow-testing/nosla-cuda11.0-cudnn8-ubuntu18.04-manylinux2010-multipython
docker run --gpus all --rm -it -v ${PWD}:/addons -w /addons gcr.io/tensorflow-testing/nosla-cuda11.2-cudnn8.1-ubuntu18.04-manylinux2010-multipython
```

Configure:
```bash
python3 -m pip install tensorflow==2.4.1
python3 -m pip install tensorflow==2.5.0
python3 ./configure.py # Links project with TensorFlow dependency
```

Expand Down Expand Up @@ -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.4.1
python3 -m pip install tensorflow==2.5.0
python3 configure.py
python3 -m pip install -r tools/install_deps/pytest.txt
bazel test -c opt -k \
Expand Down
12 changes: 6 additions & 6 deletions build_deps/toolchains/gcc7_manylinux2010-nvcc-cuda11/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ cc_toolchain_config(
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include",
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include-fixed",
"/dt7/usr/include",
"/usr/local/cuda-11.0/targets/x86_64-linux/include",
"/usr/local/cuda-11.0/include",
"/usr/local/cuda-11.0/extras/CUPTI/include",
"/usr/local/cuda-11.2/targets/x86_64-linux/include",
"/usr/local/cuda-11.2/include",
"/usr/local/cuda-11.2/extras/CUPTI/include",
"/usr/include",
],
cpu = "local",
Expand Down Expand Up @@ -93,9 +93,9 @@ cc_toolchain_config(
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include",
"/dt7/usr/lib/gcc/x86_64-pc-linux-gnu/7/include-fixed",
"/dt7/usr/include",
"/usr/local/cuda-11.0/targets/x86_64-linux/include",
"/usr/local/cuda-11.0/include",
"/usr/local/cuda-11.0/extras/CUPTI/include",
"/usr/local/cuda-11.2/targets/x86_64-linux/include",
"/usr/local/cuda-11.2/include",
"/usr/local/cuda-11.2/extras/CUPTI/include",
"/usr/include",
],
cpu = "darwin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ import pipes
CPU_COMPILER = ('/dt7/usr/bin/gcc')
GCC_HOST_COMPILER_PATH = ('/dt7/usr/bin/gcc')

NVCC_PATH = '/usr/local/cuda-11.0/bin/nvcc'
NVCC_PATH = '/usr/local/cuda-11.2/bin/nvcc'
PREFIX_DIR = os.path.dirname(GCC_HOST_COMPILER_PATH)
NVCC_VERSION = '11.0'
NVCC_VERSION = '11.2'

def Log(s):
print('gpus/crosstool: {0}'.format(s))
Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def configure_cuda():
"CUDNN_INSTALL_PATH",
os.getenv("CUDNN_INSTALL_PATH", "/usr/lib/x86_64-linux-gnu"),
)
write_action_env("TF_CUDA_VERSION", os.getenv("TF_CUDA_VERSION", "11"))
write_action_env("TF_CUDA_VERSION", os.getenv("TF_CUDA_VERSION", "11.2"))
write_action_env("TF_CUDNN_VERSION", os.getenv("TF_CUDNN_VERSION", "8"))

write("test --config=cuda")
Expand Down
6 changes: 6 additions & 0 deletions tensorflow_addons/text/crf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
# ==============================================================================
import warnings
from distutils.version import LooseVersion

import numpy as np
import tensorflow as tf
Expand Down Expand Up @@ -539,6 +540,11 @@ def crf_decode(
warnings.warn(
"CRF Decoding does not work with KerasTensors in TF2.4. The bug has since been fixed in tensorflow/tensorflow##45534"
)

if LooseVersion(tf.__version__) >= LooseVersion("2.5.0"):
warnings.warn(
"CRF decoding models have serialization issues in TF >=2.5 . Please see isse #2476"
)
sequence_length = tf.cast(sequence_length, dtype=tf.int32)

# If max_seq_len is 1, we skip the algorithm and simply return the
Expand Down
13 changes: 12 additions & 1 deletion tensorflow_addons/text/tests/crf_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Tests for CRF."""

import itertools
from distutils.version import LooseVersion

import pytest
import numpy as np
Expand Down Expand Up @@ -501,6 +502,10 @@ def test_tf_function():
tf.__version__[:3] == "2.4",
reason="CRF Decode doesn't work in TF2.4, the issue was fixed in TF core, but didn't make the release",
)
@pytest.mark.skipif(
tf.__version__[:3] == "2.5",
reason="CRF decoding models have serialization issues in TF >=2.5 . Please see isse #2476",
)
def test_crf_decode_save_load(tmpdir):
tf.keras.backend.clear_session()
input_tensor = tf.keras.Input(shape=(10, 3), dtype=tf.float32, name="input_tensor")
Expand All @@ -519,7 +524,13 @@ def test_crf_decode_save_load(tmpdir):
"input_tensor": np.random.random_sample((5, 10, 3)).astype(dtype=np.float32),
"seq_len": np.array([10] * 5, dtype=np.int32),
}
y_data = {"tf_op_layer_Mul": np.random.randint(0, 3, (5, 10))}

tensor_name = (
"tf.math.multiply"
if LooseVersion(tf.__version__) >= "2.5.0"
else "tf_op_layer_Mul"
)
y_data = {tensor_name: np.random.randint(0, 3, (5, 10))}

model.fit(x_data, y_data)
model.predict(
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_addons/utils/resource_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

import tensorflow as tf

INCLUSIVE_MIN_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.4.0"
EXCLUSIVE_MAX_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.5.0"
INCLUSIVE_MIN_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.5.0"
EXCLUSIVE_MAX_TF_VERSION_FOR_ABI_COMPATIBILITY = "2.6.0"
abi_warning_already_raised = False
SKIP_CUSTOM_OPS = False

Expand Down
2 changes: 1 addition & 1 deletion tensorflow_addons/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# Required TensorFlow version [min, max)
INCLUSIVE_MIN_TF_VERSION = "2.3.0"
EXCLUSIVE_MAX_TF_VERSION = "2.5.0"
EXCLUSIVE_MAX_TF_VERSION = "2.6.0"

# We follow Semantic Versioning (https://semver.org/)
_MAJOR_VERSION = "0"
Expand Down
2 changes: 1 addition & 1 deletion tools/build_dev_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -x -e

DOCKER_BUILDKIT=1 docker build \
-f tools/docker/dev_container.Dockerfile \
--build-arg TF_VERSION=2.4.1 \
--build-arg TF_VERSION=2.5.0 \
--build-arg TF_PACKAGE=tensorflow-cpu \
--target dev_container_cpu \
-t tfaddons/dev_container:latest-cpu ./
2 changes: 1 addition & 1 deletion tools/docker/build_wheel.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#syntax=docker/dockerfile:1.1.5-experimental
ARG TF_VERSION
ARG PY_VERSION
FROM gcr.io/tensorflow-testing/nosla-cuda11.0-cudnn8-ubuntu18.04-manylinux2010-multipython as base_install
FROM gcr.io/tensorflow-testing/nosla-cuda11.2-cudnn8.1-ubuntu18.04-manylinux2010-multipython as base_install
ENV TF_NEED_CUDA="1"

# Required for setuptools v50.0.0
Expand Down
2 changes: 1 addition & 1 deletion tools/docker/cpu_tests.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#syntax=docker/dockerfile:1.1.5-experimental
FROM python:3.6 as build_wheel

ARG TF_VERSION=2.4.1
ARG TF_VERSION=2.5.0
RUN pip install --default-timeout=1000 tensorflow-cpu==$TF_VERSION

RUN apt-get update && apt-get install -y sudo rsync
Expand Down
2 changes: 1 addition & 1 deletion tools/install_deps/pytest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pytest-xdist~=1.31
pytest-extra-durations~=0.1.3
scikit-learn~=0.22
scikit-image~=0.17.0
Pillow~=7.0.0
Pillow~=8.0.0
tqdm>=4.36.1
2 changes: 1 addition & 1 deletion tools/install_deps/tensorflow-cpu.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tensorflow-cpu~=2.4.1
tensorflow-cpu~=2.5.0
2 changes: 1 addition & 1 deletion tools/install_deps/tensorflow.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tensorflow~=2.4.1
tensorflow~=2.5.0
2 changes: 1 addition & 1 deletion tools/run_gpu_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.4.1 \
--build-arg TF_VERSION=2.5.0 \
--build-arg PY_VERSION=3.6 \
-t tfa_gpu_tests ./
docker run --rm -t --gpus=all tfa_gpu_tests