Skip to content

Commit ba467f4

Browse files
jrhdongpoinwater
authored
switch tf version to 2.15.0 (#388)
update the CI docker images for TF2.15.x Co-authored-by: rhdong <[email protected]> Co-authored-by: poinwater <[email protected]>
1 parent 095db80 commit ba467f4

Some content is hidden

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

55 files changed

+625
-3190
lines changed

.github/workflows/ci_test.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
name: Check that the source code is compliant
2323
runs-on: ubuntu-latest
2424
steps:
25+
- uses: actions/setup-python@v1
26+
with:
27+
python-version: 3.9
2528
- uses: actions/checkout@v2
2629
- name: Run type check
2730
run: bash tools/run_build.sh source_code_test
@@ -57,13 +60,19 @@ jobs:
5760
name: Check that we can build the docs
5861
runs-on: ubuntu-latest
5962
steps:
63+
- uses: actions/setup-python@v1
64+
with:
65+
python-version: 3.9
6066
- uses: actions/checkout@v2
6167
- name: Building the docs
6268
run: bash tools/run_build.sh docs_tests
6369
test_cpu_in_small_docker_image:
6470
name: Run the cpu tests in a small python docker image
6571
runs-on: ubuntu-latest
6672
steps:
73+
- uses: actions/setup-python@v1
74+
with:
75+
python-version: 3.9
6776
- uses: actions/checkout@v2
6877
- run: bash tools/run_cpu_tests.sh
6978
valid-codeowners:
@@ -82,29 +91,33 @@ jobs:
8291
runs-on: ubuntu-latest
8392
steps:
8493
- uses: actions/setup-python@v1
94+
with:
95+
python-version: 3.9
8596
- uses: actions/checkout@v2
8697
- name: Install tensorflow-docs
8798
run: python3 -m pip install -U git+https://github.com/tensorflow/docs
8899
- name: Check notebook formatting
89100
run: |
90101
# Run on all notebooks to prevent upstream change.
91102
echo "Check formatting with nbfmt:"
92-
python3 -m pip install --upgrade protobuf==3.20.0
103+
python3 -m pip install --upgrade protobuf==4.23.4
93104
python3 -m tensorflow_docs.tools.nbfmt --test \
94105
$(find docs/tutorials/ -type f -name *.ipynb)
95106
nblint:
96107
name: Notebook lint
97108
runs-on: ubuntu-latest
98109
steps:
99110
- uses: actions/setup-python@v1
111+
with:
112+
python-version: 3.9
100113
- uses: actions/checkout@v2
101114
- name: Install tensorflow-docs
102115
run: python3 -m pip install -U git+https://github.com/tensorflow/docs
103116
- name: Lint notebooks
104117
run: |
105118
# Run on all notebooks to prevent upstream change.
106119
echo "Lint check with nblint:"
107-
python3 -m pip install --upgrade protobuf==3.20.0
120+
python3 -m pip install --upgrade protobuf==4.23.4
108121
python3 -m tensorflow_docs.tools.nblint \
109122
--arg=repo:tensorflow/recommenders-addons \
110123
--exclude_lint=tensorflow::button_colab \

.github/workflows/make_wheel_Linux_x86.sh

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,27 @@ docker info
55
# to get more disk space
66
rm -rf /usr/share/dotnet &
77

8-
if [ $TF_NEED_CUDA -eq "1" ] ; then
9-
export TF_NAME='tensorflow-gpu'
10-
else
11-
export TF_NAME='tensorflow'
12-
fi
8+
export TF_NAME='tensorflow'
139

14-
# if tensorflow version >= 2.6.0 and <= 2.11.9
15-
if [[ "$TF_VERSION" =~ ^2\.([6-9]|10|11)\.[0-9]$ ]] ; then
16-
export BUILD_IMAGE="tfra/nosla-cuda11.2.1-cudnn8-ubuntu20.04-manylinux2014-python$PY_VERSION"
10+
# if tensorflow version >= 2.6.0 and <= 2.15.9
11+
if [[ "$TF_VERSION" =~ ^2\.(16)\.[0-9]+$ ]] ; then
12+
export BUILD_IMAGE="tfra/nosla-cuda12.3-cudnn8.9-ubuntu20.04-manylinux2014-python$PY_VERSION"
13+
export TF_CUDA_VERSION="12.3"
14+
export TF_CUDNN_VERSION="8.9"
15+
elif [[ "$TF_VERSION" =~ ^2\.(15)\.[0-9]+$ ]] ; then
16+
export BUILD_IMAGE="tfra/nosla-cuda12.2-cudnn8.9-ubuntu20.04-manylinux2014-python$PY_VERSION"
17+
export TF_CUDA_VERSION="12.2"
18+
export TF_CUDNN_VERSION="8.9"
19+
elif [[ "$TF_VERSION" =~ ^2\.(14)\.[0-9]+$ ]] ; then
20+
export BUILD_IMAGE="tfra/nosla-cuda11.8-cudnn8.7-ubuntu20.04-manylinux2014-python$PY_VERSION"
21+
export TF_CUDA_VERSION="11.8"
22+
export TF_CUDNN_VERSION="8.7"
23+
elif [[ "$TF_VERSION" =~ ^2\.(12|13)\.[0-9]+$ ]] ; then
24+
export BUILD_IMAGE="tfra/nosla-cuda11.8-cudnn8.6-ubuntu20.04-manylinux2014-python$PY_VERSION"
25+
export TF_CUDA_VERSION="11.8"
26+
export TF_CUDNN_VERSION="8.6"
27+
elif [[ "$TF_VERSION" =~ ^2\.([6-9]|10|11)\.[0-9]+$ ]] ; then
28+
export BUILD_IMAGE="tfra/nosla-cuda11.2-cudnn8-ubuntu20.04-manylinux2014-python$PY_VERSION"
1729
export TF_CUDA_VERSION="11.2"
1830
export TF_CUDNN_VERSION="8.1"
1931
elif [ $TF_VERSION == "2.4.1" ] ; then
@@ -29,8 +41,18 @@ else
2941
exit 1
3042
fi
3143

44+
echo "BUILD_IMAGE is $BUILD_IMAGE"
45+
echo "TF_CUDA_VERSION is $TF_CUDA_VERSION"
46+
echo "TF_CUDNN_VERSION is $TF_CUDNN_VERSION"
47+
3248
if [ -z $HOROVOD_VERSION ] ; then
33-
export HOROVOD_VERSION='0.23.0'
49+
export HOROVOD_VERSION='0.28.1'
50+
fi
51+
52+
# For TensorFlow version 2.13 or later:
53+
export PROTOBUF_VERSION='3.19.6'
54+
if [[ "$TF_VERSION" =~ ^2\.1[3-9]\.[0-9]$ ]] ; then
55+
export PROTOBUF_VERSION='4.23.4'
3456
fi
3557

3658
DOCKER_BUILDKIT=1 docker build --no-cache \
@@ -46,4 +68,5 @@ DOCKER_BUILDKIT=1 docker build --no-cache \
4668
--build-arg BUILD_IMAGE \
4769
--build-arg NIGHTLY_FLAG \
4870
--build-arg NIGHTLY_TIME \
71+
--build-arg PROTOBUF_VERSION \
4972
./

.github/workflows/make_wheel_Windows_x86.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ export TF_NEED_CUDA=0
44
export BAZEL_VC="C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/"
55

66
if [ -z $HOROVOD_VERSION ] ; then
7-
export HOROVOD_VERSION='0.23.0'
7+
export HOROVOD_VERSION='0.28.1'
88
fi
99

1010
python -m pip install --default-timeout=1000 wheel setuptools tensorflow==$TF_VERSION horovod==$HOROVOD_VERSION
1111
python -m pip install tensorflow-io
12-
python -m pip install --upgrade protobuf==3.20.0
12+
# For TensorFlow version 2.12 or earlier:
13+
export PROTOBUF_VERSION=3.19.6
14+
if [[ "$TF_VERSION" =~ ^2\.1[3-9]\.[0-9]$ ]] ; then
15+
export PROTOBUF_VERSION=4.23.4
16+
fi
17+
18+
python -m pip install --upgrade protobuf~=$PROTOBUF_VERSION
1319

1420
bash ./tools/testing/build_and_run_tests.sh
1521

.github/workflows/make_wheel_macOS_arm64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ python --version
1919
python -m pip install --default-timeout=1000 delocate==0.10.3 wheel setuptools
2020
# For TensorFlow version 2.13 or later:
2121
if [[ "$TF_VERSION" =~ ^2\.1[3-9]\.[0-9]$ ]] ; then
22-
export PROTOBUF_VERSION=3.20.3
22+
export PROTOBUF_VERSION=4.23.4
2323
export TF_NAME="tensorflow"
2424
fi
2525

.github/workflows/make_wheel_macOS_x86.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ if [ -z $HOROVOD_VERSION ] ; then
66
fi
77
python --version
88

9+
# For TensorFlow version 2.12 or earlier:
10+
export PROTOBUF_VERSION=3.19.6
11+
if [[ "$TF_VERSION" =~ ^2\.1[3-9]\.[0-9]$ ]] ; then
12+
export PROTOBUF_VERSION=4.23.4
13+
fi
14+
915
brew install open-mpi
1016
python -m pip install --default-timeout=1000 delocate==0.10.3 wheel==0.36.2 setuptools tensorflow==$TF_VERSION
1117
python -m pip install tensorflow-io
12-
python -m pip install --upgrade protobuf==3.20.0
18+
python -m pip install --upgrade protobuf~=$PROTOBUF_VERSION
1319

1420
bash tools/docker/install/install_horovod.sh $HOROVOD_VERSION --only-cpu
1521

.github/workflows/release.yml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ on:
1616

1717
env:
1818
MIN_PY_VERSION: '3.7'
19-
MAX_PY_VERSION: '3.10'
20-
HOROVOD_VERSION: '0.23.0'
19+
MAX_PY_VERSION: '3.11'
20+
HOROVOD_VERSION: '0.28.1'
2121

2222
jobs:
2323
test-with-bazel:
@@ -34,7 +34,7 @@ jobs:
3434
sudo apt install -y redis > /dev/null 2> /dev/null
3535
bash tools/install_deps/install_bazelisk.sh ./
3636
python -m pip install tensorflow-io
37-
python -m pip install --upgrade protobuf==3.20.0
37+
python -m pip install --upgrade protobuf==4.23.4
3838
python configure.py
3939
bazel test --local_ram_resources=4096 -c opt -k --test_timeout 300,450,1200,3600 --test_output=errors //tensorflow_recommenders_addons/...
4040
release-wheel:
@@ -43,16 +43,20 @@ jobs:
4343
matrix:
4444
# TODO: add back 'windows-latest' when it can be compiled.
4545
os: ['macos-12', 'ubuntu-20.04']
46-
py-version: ['3.7', '3.8', '3.9', '3.10']
47-
tf-version: ['2.8.3', '2.11.0']
46+
py-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
47+
tf-version: ['2.11.0', '2.15.1']
4848
tf-need-cuda: ['0', '1']
49-
tf-cuda-version: ['11.2']
50-
tf-cudnn-version: ['8.1']
5149
cpu: ['x86']
5250
exclude:
5351
# excludes cuda on macOS
5452
- os: 'macos-12'
5553
tf-need-cuda: '1'
54+
- tf-version: '2.11.0'
55+
py-version: '3.11'
56+
- tf-version: '2.15.1'
57+
py-version: '3.7'
58+
- tf-version: '2.15.1'
59+
py-version: '3.8'
5660
fail-fast: false
5761
runs-on: ${{ matrix.os }}
5862
steps:
@@ -65,7 +69,7 @@ jobs:
6569
script: |
6670
const commit_details = await github.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha});
6771
return commit_details.data.author.date
68-
- if: matrix.tf-version != '2.11.0'
72+
- if: matrix.tf-version != '2.15.1'
6973
shell: bash
7074
run: echo "SKIP_CUSTOM_OP_TESTS=--skip-custom-ops" >> $GITHUB_ENV
7175
- if: github.event_name == 'push'
@@ -85,13 +89,11 @@ jobs:
8589
PY_VERSION: ${{ matrix.py-version }}
8690
TF_VERSION: ${{ matrix.tf-version }}
8791
TF_NEED_CUDA: ${{ matrix.tf-need-cuda }}
88-
TF_CUDA_VERSION: ${{ matrix.tf-cuda-version }}
89-
TF_CUDNN_VERSION: ${{ matrix.tf-cudnn-version }}
9092
NIGHTLY_TIME: ${{ steps.author-date.outputs.result }}
9193
CPU: ${{ matrix.cpu }}
9294
shell: bash
9395
run: |
94-
if [[ "$TF_VERSION" =~ ^2\.(9|10|11)\.[0-9]$ ]] ; then
96+
if [[ "$TF_VERSION" =~ ^2\.(11|12|13|14|15)\.[0-9]$ ]] ; then
9597
export HOROVOD_VERSION="0.28.1"
9698
fi
9799
bash .github/workflows/make_wheel_${OS}_${CPU}.sh
@@ -113,13 +115,20 @@ jobs:
113115
matrix:
114116
# TODO: add back 'Windows' when it can be compiled.
115117
os: ['macOS', 'Linux']
116-
py-version: ['3.7', '3.8', '3.9', '3.10']
118+
py-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
119+
tf-version: ['2.15.1']
117120
tf-need-cuda: ['0', '1']
118121
cpu: ['x86']
119122
exclude:
120123
# excludes cuda on macOS
121124
- os: 'macOS'
122125
tf-need-cuda: '1'
126+
- tf-version: '2.11.0'
127+
py-version: '3.11'
128+
- tf-version: '2.15.1'
129+
py-version: '3.7'
130+
- tf-version: '2.15.1'
131+
py-version: '3.8'
123132
fail-fast: false
124133
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release'
125134
steps:
@@ -147,7 +156,7 @@ jobs:
147156
runs-on: ubuntu-20.04
148157
strategy:
149158
matrix:
150-
py-version: ['3.7', '3.8', '3.9', '3.10']
159+
py-version: ['3.10']
151160
if: (github.event_name == 'push' && github.ref == 'refs/heads/master')
152161
steps:
153162
- uses: actions/checkout@v2

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ See our [Style Guide](STYLE_GUIDE.md) for more details.
6262
### Additional Requirements
6363
In addition to the above requirements, contribution also needs to meet the following criteria:
6464
* The functionality is not otherwise available in TensorFlow.
65-
* It has to be compatible with TensorFlow 2.6.3 and 2.8.3.
65+
* It has to be compatible with TensorFlow 2.6.3 and 2.15.1.
6666
* The change needs to include unit tests and integration tests if any.
6767
* Each project needs to provide documentation for when and how to use it.
6868

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ Check [nvidia-support-matrix](https://docs.nvidia.com/deeplearning/cudnn/support
128128
- Due to the significant changes in the Tensorflow API, we can only ensure version 0.2.0 compatibility with TF1.15.2 on CPU & GPU,
129129
but **there are no official releases**, you can only get it through compiling by the following:
130130
```sh
131-
PY_VERSION="3.7" \
132-
TF_VERSION="1.15.2" \
131+
PY_VERSION="3.9" \
132+
TF_VERSION="2.15.1" \
133133
TF_NEED_CUDA=1 \
134134
sh .github/workflows/make_wheel_Linux_x86.sh
135135

@@ -144,7 +144,7 @@ At the same time, we find some OPs used by TRFA have better performance, so we h
144144

145145
For all developers, we recommend you use the development docker containers which are all GPU enabled:
146146
```sh
147-
docker pull tfra/dev_container:latest-python3.8 # "3.7", "3.9" are all avaliable.
147+
docker pull tfra/dev_container:latest-python3.9 # "3.9" “3.10” are all avaliable.
148148
docker run --privileged --gpus all -it --rm -v $(pwd):$(pwd) tfra/dev_container:latest-3.8
149149
```
150150

@@ -154,8 +154,8 @@ Please install a TensorFlow on your compiling machine, The compiler needs to kno
154154
its headers according to the installed TensorFlow.
155155

156156
```sh
157-
export TF_VERSION="2.8.3" # "2.6.3" are well tested.
158-
pip install tensorflow[-gpu]==$TF_VERSION
157+
export TF_VERSION="2.15.1" # "2.11.0" are well tested.
158+
pip install tensorflow==$TF_VERSION
159159

160160
git clone https://github.com/tensorflow/recommenders-addons.git
161161
cd recommenders-addons
@@ -171,11 +171,11 @@ pip install artifacts/tensorflow_recommenders_addons-*.whl
171171
#### GPU Support
172172
Only `TF_NEED_CUDA=1` is required and other environment variables are optional:
173173
```sh
174-
export TF_VERSION="2.8.3" # "2.6.3" is well tested.
175-
export PY_VERSION="3.8"
174+
export TF_VERSION="2.15.1" # "2.11.0" is well tested.
175+
export PY_VERSION="3.9"
176176
export TF_NEED_CUDA=1
177-
export TF_CUDA_VERSION=11.2
178-
export TF_CUDNN_VERSION=8.1
177+
export TF_CUDA_VERSION=12.2
178+
export TF_CUDNN_VERSION=8.9
179179
export CUDA_TOOLKIT_PATH="/usr/local/cuda"
180180
export CUDNN_INSTALL_PATH="/usr/lib/x86_64-linux-gnu"
181181

configure.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,9 @@ def get_tf_shared_lib_dir():
112112
# Converts the linkflag namespec to the full shared library name
113113
def get_shared_lib_name():
114114
namespec = tf.sysconfig.get_link_flags()
115-
if is_macos() and is_arm64():
116-
# MacOS arm64
117-
return "libtensorflow_framework.2.dylib"
118-
elif is_macos():
115+
if is_macos():
119116
# MacOS
120-
return "libtensorflow_framework.dylib"
117+
return "lib" + namespec[1][2:] + ".dylib"
121118
elif is_windows():
122119
# Windows
123120
return "_pywrap_tensorflow_internal.lib"
@@ -138,6 +135,7 @@ def get_tf_version_integer():
138135
2.4.1 get 2041
139136
2.6.3 get 2063
140137
2.8.3 get 2083
138+
2.15.1 get 2151
141139
142140
The 4-digits-string will be passed to C macro to discriminate different
143141
Tensorflow versions.
@@ -152,7 +150,8 @@ def get_tf_version_integer():
152150
'\nPlease install a TensorFlow on your compiling machine, '
153151
'The compiler needs to know the version of Tensorflow '
154152
'and get TF c++ headers according to the installed TensorFlow. '
155-
'\nNote: Only TensorFlow 2.8.3, 2.6.3, 2.4.1, 1.15.2 are supported.')
153+
'\nNote: Only TensorFlow 2.15.1 2.8.3, 2.6.3, 2.4.1, 1.15.2 are supported.'
154+
)
156155
try:
157156
major, minor, patch = version.split('.')
158157
assert len(

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def get_project_name_version():
6363

6464
if os.getenv("TF_NEED_CUDA", "0") == "1":
6565
project_name = project_name + "-gpu"
66-
version["tf_project_name"] = "tensorflow-gpu"
6766

6867
if "--nightly" in sys.argv:
6968
project_name = "tfra-nightly"
@@ -118,9 +117,9 @@ def has_ext_modules(self):
118117
"Intended Audience :: Science/Research",
119118
"License :: OSI Approved :: Apache Software License",
120119
"Programming Language :: Python :: 3",
121-
"Programming Language :: Python :: 3.7",
122-
"Programming Language :: Python :: 3.8",
123120
"Programming Language :: Python :: 3.9",
121+
"Programming Language :: Python :: 3.10",
122+
"Programming Language :: Python :: 3.11",
124123
"Topic :: Scientific/Engineering :: Mathematics",
125124
"Topic :: Software Development :: Libraries :: Python Modules",
126125
"Topic :: Software Development :: Libraries",

0 commit comments

Comments
 (0)