Skip to content

Commit 61822e6

Browse files
Upgrade to TensorFlow 2.5.0. (#567)
* Upgrade to TensorFlow 2.5.0. * docs update for source builds. * fix grpcio version.
1 parent 3036034 commit 61822e6

File tree

5 files changed

+37
-27
lines changed

5 files changed

+37
-27
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.0
1+
3.7.2

WORKSPACE

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@
44

55
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
66

7-
http_archive(
8-
name = "com_google_absl",
9-
sha256 = "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a",
10-
strip_prefix = "abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d",
11-
urls = [
12-
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz",
13-
"https://github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz",
14-
],
15-
)
16-
177
http_archive(
188
name = "com_google_googletest",
199
sha256 = "ff7a82736e158c077e76188232eac77913a15dac0b22508c390ab3f88e6d6d86",
@@ -53,9 +43,11 @@ protobuf_deps()
5343
# com_google_protobuf depends on @bazel_skylib ??
5444
http_archive(
5545
name = "bazel_skylib",
56-
sha256 = "bbccf674aa441c266df9894182d80de104cabd19be98be002f6d478aaa31574d",
57-
strip_prefix = "bazel-skylib-2169ae1c374aab4a09aa90e65efe1a3aad4e279b",
58-
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"],
46+
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
47+
urls = [
48+
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
49+
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
50+
],
5951
)
6052

6153
http_archive(
@@ -85,16 +77,28 @@ http_archive(
8577

8678
http_archive(
8779
name = "org_tensorflow",
88-
sha256 = "b91ec194ddf6c4a5a2f9d1db4af4daab0b187ff691e6f88142413d2c7e77a3bb",
89-
strip_prefix = "tensorflow-2.4.1",
80+
sha256 = "e3d0ee227cc19bd0fa34a4539c8a540b40f937e561b4580d4bbb7f0e31c6a713",
81+
strip_prefix = "tensorflow-2.5.0",
9082
urls = [
91-
"https://github.com/tensorflow/tensorflow/archive/v2.4.1.zip",
83+
"https://github.com/tensorflow/tensorflow/archive/v2.5.0.zip",
9284
],
9385
)
9486

95-
load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace")
87+
load("@org_tensorflow//tensorflow:workspace3.bzl", "workspace")
88+
89+
workspace()
90+
91+
load("@org_tensorflow//tensorflow:workspace2.bzl", "workspace")
92+
93+
workspace()
94+
95+
load("@org_tensorflow//tensorflow:workspace1.bzl", "workspace")
96+
97+
workspace()
98+
99+
load("@org_tensorflow//tensorflow:workspace0.bzl", "workspace")
96100

97-
tf_workspace(tf_repo_name = "@org_tensorflow")
101+
workspace()
98102

99103
load("//third_party/tf:tf_configure.bzl", "tf_configure")
100104

docs/install.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ As noted in the TensorFlow
8484
guide, the <a href="https://bazel.build/" class="external">Bazel</a>
8585
build system will be required.
8686

87-
Our latest source builds use TensorFlow 2.4.1. To ensure compatibility we use `bazel` version 3.1.0. To remove any existing version of Bazel:
87+
Our latest source builds use TensorFlow 2.5.0. To ensure compatibility we use `bazel` version 3.7.2. To remove any existing version of Bazel:
8888

8989
<!-- common_typos_disable -->
9090
<pre class="devsite-click-to-copy">
@@ -96,9 +96,9 @@ Download and install `bazel` version 3.1.0:
9696

9797
<!-- common_typos_disable -->
9898
<pre class="devsite-click-to-copy">
99-
<code class="devsite-terminal">wget https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel_3.1.0-linux-x86_64.deb
99+
<code class="devsite-terminal">wget https://github.com/bazelbuild/bazel/releases/download/3.7.2/bazel_3.7.2-linux-x86_64.deb
100100
</code>
101-
<code class="devsite-terminal">sudo dpkg -i bazel_3.1.0-linux-x86_64.deb</code>
101+
<code class="devsite-terminal">sudo dpkg -i bazel_3.7.2-linux-x86_64.deb</code>
102102
</pre>
103103
<!-- common_typos_enable -->
104104

@@ -122,7 +122,7 @@ Finally, confirm installation of the correct `bazel` version:
122122
### 4. Build TensorFlow from source
123123

124124
Here we adapt instructions from the TensorFlow [build from source](https://www.tensorflow.org/install/source)
125-
guide, see the link for further details. TensorFlow Quantum is compatible with TensorFlow version&nbsp;2.4.
125+
guide, see the link for further details. TensorFlow Quantum is compatible with TensorFlow version&nbsp;2.5.
126126

127127
Download the
128128
<a href="https://github.com/tensorflow/tensorflow" class="external">TensorFlow source code</a>:
@@ -131,7 +131,7 @@ Download the
131131
<pre class="devsite-click-to-copy">
132132
<code class="devsite-terminal">git clone https://github.com/tensorflow/tensorflow.git</code>
133133
<code class="devsite-terminal">cd tensorflow</code>
134-
<code class="devsite-terminal">git checkout v2.4.1</code>
134+
<code class="devsite-terminal">git checkout v2.5.0</code>
135135
</pre>
136136

137137
Be sure the virtual environment you created in step 2 is activated. Then, install the TensorFlow dependencies:

release/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def finalize_options(self):
5858

5959
# placed as extra to not have required overwrite existing nightly installs if
6060
# they exist.
61-
EXTRA_PACKAGES = ['tensorflow == 2.4.1']
61+
EXTRA_PACKAGES = ['tensorflow == 2.5.0']
6262
CUR_VERSION = '0.5.0'
6363

6464

@@ -106,6 +106,7 @@ def has_ext_modules(self):
106106
'Programming Language :: Python :: 3',
107107
'Programming Language :: Python :: 3.6',
108108
'Programming Language :: Python :: 3.7',
109+
'Programming Language :: Python :: 3.8',
109110
'Topic :: Scientific/Engineering',
110111
'Topic :: Scientific/Engineering :: Artificial Intelligence',
111112
'Topic :: Scientific/Engineering :: Mathematics',

requirements.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
cirq==0.10.0
22
sympy==1.5
3+
numpy==1.19.5 # TensorFlow can detect if it was built against other versions.
34
nbconvert==5.6.1
45
nbformat==4.4.0
56
pylint==2.4.4
67
yapf==0.28.0
7-
tensorflow==2.4.1
8-
google-api-python-client==1.8.0
8+
tensorflow==2.5.0
99
# Needed for compatibility with cirq program protos.
1010
googleapis-common-protos==1.52.0
11+
google-api-core==1.21.0
12+
google-auth==1.18.0
13+
google-api-python-client==1.8.0
14+
grpcio==1.34.1
15+
protobuf==3.13.0

0 commit comments

Comments
 (0)