Skip to content

Commit

Permalink
Change build to tf 2.16.1 (#1977)
Browse files Browse the repository at this point in the history
* Change build to tf 2.16.1

* Patch tensorflow to avoid cython error

* Update to 3.12

* Update 3.12 for arm64

* Fix WORKSPACE
  • Loading branch information
yongtang authored Apr 11, 2024
1 parent 4d70341 commit 5c914ab
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.1.0
6.5.0
7 changes: 6 additions & 1 deletion .github/workflows/build.arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: macos-13-xlarge
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
Expand Down Expand Up @@ -85,12 +85,17 @@ jobs:
with:
name: macOS-arm64-3.11-wheel
path: macOS-arm64-3.11-wheel
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: macOS-arm64-3.12-wheel
path: macOS-arm64-3.12-wheel
- run: |
set -e -x
mkdir -p wheelhouse
cp macOS-arm64-3.9-wheel/*.whl wheelhouse/
cp macOS-arm64-3.10-wheel/*.whl wheelhouse/
cp macOS-arm64-3.11-wheel/*.whl wheelhouse/
cp macOS-arm64-3.12-wheel/*.whl wheelhouse/
ls -la wheelhouse/
sha256sum wheelhouse/*.whl
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
Expand Down
45 changes: 39 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
runs-on: macOS-11
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
Expand Down Expand Up @@ -284,7 +284,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
Expand Down Expand Up @@ -400,7 +400,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
Expand Down Expand Up @@ -499,6 +499,10 @@ jobs:
with:
name: macOS-3.11-wheel
path: macOS-3.11-wheel
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: macOS-3.12-wheel
path: macOS-3.12-wheel
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: Linux-3.9-wheel
Expand All @@ -511,6 +515,10 @@ jobs:
with:
name: Linux-3.11-wheel
path: Linux-3.11-wheel
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: Linux-3.12-wheel
path: Linux-3.12-wheel
#- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
# with:
# name: Windows-3.9-wheel
Expand All @@ -523,18 +531,25 @@ jobs:
# with:
# name: Windows-3.11-wheel
# path: Windows-3.11-wheel
#- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
# with:
# name: Windows-3.12-wheel
# path: Windows-3.12-wheel
- run: |
set -e -x
mkdir -p wheelhouse
cp macOS-3.9-wheel/*.whl wheelhouse/
cp macOS-3.10-wheel/*.whl wheelhouse/
cp macOS-3.11-wheel/*.whl wheelhouse/
cp macOS-3.12-wheel/*.whl wheelhouse/
cp Linux-3.9-wheel/*.whl wheelhouse/
cp Linux-3.10-wheel/*.whl wheelhouse/
cp Linux-3.11-wheel/*.whl wheelhouse/
cp Linux-3.12-wheel/*.whl wheelhouse/
# cp Windows-3.9-wheel/*.whl wheelhouse/
# cp Windows-3.10-wheel/*.whl wheelhouse/
# cp Windows-3.11-wheel/*.whl wheelhouse/
# cp Windows-3.12-wheel/*.whl wheelhouse/
ls -la wheelhouse/
sha256sum wheelhouse/*.whl
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
Expand Down Expand Up @@ -625,7 +640,7 @@ jobs:
runs-on: macOS-11
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
Expand Down Expand Up @@ -672,7 +687,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
Expand Down Expand Up @@ -712,7 +727,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
Expand Down Expand Up @@ -760,6 +775,10 @@ jobs:
with:
name: macOS-3.11-nightly
path: macOS-3.11-nightly
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: macOS-3.12-nightly
path: macOS-3.12-nightly
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: Linux-3.9-nightly
Expand All @@ -772,6 +791,10 @@ jobs:
with:
name: Linux-3.11-nightly
path: Linux-3.11-nightly
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: Linux-3.12-nightly
path: Linux-3.12-nightly
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: Windows-3.9-nightly
Expand All @@ -784,18 +807,25 @@ jobs:
with:
name: Windows-3.11-nightly
path: Windows-3.11-nightly
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
with:
name: Windows-3.12-nightly
path: Windows-3.12-nightly
- run: |
set -e -x
mkdir -p dist
cp macOS-3.9-nightly/tensorflow_io_nightly*.whl dist/
cp macOS-3.10-nightly/tensorflow_io_nightly*.whl dist/
cp macOS-3.11-nightly/tensorflow_io_nightly*.whl dist/
cp macOS-3.12-nightly/tensorflow_io_nightly*.whl dist/
cp Linux-3.9-nightly/tensorflow_io_nightly*.whl dist/
cp Linux-3.10-nightly/tensorflow_io_nightly*.whl dist/
cp Linux-3.11-nightly/tensorflow_io_nightly*.whl dist/
cp Linux-3.12-nightly/tensorflow_io_nightly*.whl dist/
cp Windows-3.9-nightly/tensorflow_io_nightly*.whl dist/
cp Windows-3.10-nightly/tensorflow_io_nightly*.whl dist/
cp Windows-3.11-nightly/tensorflow_io_nightly*.whl dist/
cp Windows-3.12-nightly/tensorflow_io_nightly*.whl dist/
ls -la dist/
sha256sum dist/*.whl
- uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # v1.8.11
Expand All @@ -809,12 +839,15 @@ jobs:
cp macOS-3.9-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp macOS-3.10-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp macOS-3.11-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp macOS-3.12-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Linux-3.9-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Linux-3.10-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Linux-3.11-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Linux-3.12-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Windows-3.9-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Windows-3.10-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Windows-3.11-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Windows-3.12-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
ls -la dist/
sha256sum dist/*.whl
- uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # v1.8.11
Expand Down
16 changes: 10 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,15 @@ switched_rules_by_language(

http_archive(
name = "org_tensorflow",
sha256 = "9cec5acb0ecf2d47b16891f8bc5bc6fbfdffe1700bdadc0d9ebe27ea34f0c220",
strip_prefix = "tensorflow-2.15.0",
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",
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",
],
)

Expand Down Expand Up @@ -880,10 +885,9 @@ http_archive(
# Needed for llvm_toolchain and Golang
http_archive(
name = "com_grail_bazel_toolchain",
sha256 = "9e6065ded4b7453143e1586d6819729a63cd233114b72bf85ff3435367b02c90",
strip_prefix = "bazel-toolchain-edd07e96a2ecaa131af9234d6582875d980c0ac7",
sha256 = "4b7999c1fa2c3117bb21651e3c155b152e44ae67b2c311214883d4707dbe183f",
strip_prefix = "toolchains_llvm-edd07e96a2ecaa131af9234d6582875d980c0ac7",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/grailbio/bazel-toolchain/archive/edd07e96a2ecaa131af9234d6582875d980c0ac7.tar.gz",
"https://github.com/grailbio/bazel-toolchain/archive/edd07e96a2ecaa131af9234d6582875d980c0ac7.tar.gz",
],
)
Expand Down
4 changes: 2 additions & 2 deletions tensorflow_io/python/ops/version_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# ==============================================================================
"""version_ops"""

version = "0.36.0"
require = "tensorflow>=2.15.0,<2.16.0"
version = "0.37.0"
require = "tensorflow>=2.16.0,<2.17.0"
2 changes: 1 addition & 1 deletion tools/docker/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARG BAZEL_OPTIMIZATION
ADD . /opt/io
WORKDIR /opt/io

RUN python${PYTHON_VERSION} -m pip install tensorflow==${TENSORFLOW_VERSION}
RUN python${PYTHON_VERSION} -m pip install tensorflow>=${TENSORFLOW_VERSION}

RUN python$PYTHON_VERSION -m pip uninstall -y tensorflow-io-gcs-filesystem

Expand Down

0 comments on commit 5c914ab

Please sign in to comment.