Skip to content

Commit d789314

Browse files
committed
Merge remote-tracking branch 'forkB/fix_warnings'
2 parents fe3a96e + 01471ee commit d789314

File tree

157 files changed

+1300
-318
lines changed

Some content is hidden

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

157 files changed

+1300
-318
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.1.0
1+
5.3.0

.github/workflows/ci.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on: [pull_request]
55
jobs:
66
lint:
77
name: Lint check
8-
runs-on: ubuntu-18.04
8+
runs-on: ubuntu-20.04
99
steps:
1010
- uses: actions/checkout@v1
1111
- uses: actions/setup-python@v1
@@ -19,7 +19,7 @@ jobs:
1919

2020
format:
2121
name: Formatting check
22-
runs-on: ubuntu-18.04
22+
runs-on: ubuntu-20.04
2323

2424
steps:
2525
- uses: actions/checkout@v1
@@ -34,7 +34,7 @@ jobs:
3434

3535
wheel-build:
3636
name: Wheel test
37-
runs-on: ubuntu-18.04
37+
runs-on: ubuntu-20.04
3838

3939
steps:
4040
- uses: actions/checkout@v1
@@ -53,7 +53,7 @@ jobs:
5353

5454
bazel-tests:
5555
name: Library tests
56-
runs-on: ubuntu-18.04
56+
runs-on: ubuntu-20.04
5757
needs: [lint, format]
5858

5959
steps:
@@ -71,7 +71,7 @@ jobs:
7171

7272
leak-tests:
7373
name: Memory Leak tests
74-
runs-on: ubuntu-18.04
74+
runs-on: ubuntu-20.04
7575
needs: [lint, format]
7676

7777
steps:
@@ -89,7 +89,7 @@ jobs:
8989

9090
tutorials-test:
9191
name: Tutorial tests
92-
runs-on: ubuntu-18.04
92+
runs-on: ubuntu-20.04
9393
needs: [lint, format, wheel-build]
9494

9595
steps:

.github/workflows/cirq_compatibility.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
name: Cirq Compatibility
23

34
on:
@@ -7,7 +8,7 @@ on:
78
jobs:
89
consistency:
910
name: Nightly Compatibility
10-
runs-on: ubuntu-16.04
11+
runs-on: ubuntu-20.04
1112
steps:
1213
- uses: actions/checkout@v1
1314
- uses: actions/setup-python@v1

WORKSPACE

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,19 @@ cc_library(
2424
],
2525
)
2626

27+
# http_archive(
28+
# name = "qsim",
29+
# sha256 = "b9c1eba09a885a938b5e73dfc2e02f5231cf3b01d899415caa24769346a731d5",
30+
# strip_prefix = "qsim-0.13.3",
31+
# urls = ["https://github.com/quantumlib/qsim/archive/refs/tags/v0.13.3.zip"],
32+
# )
33+
34+
# TODO: After merging this patch later into qsim mainstream, remove this and uncomment the above.
2735
http_archive(
2836
name = "qsim",
29-
sha256 = "b9c1eba09a885a938b5e73dfc2e02f5231cf3b01d899415caa24769346a731d5",
30-
strip_prefix = "qsim-0.13.3",
31-
urls = ["https://github.com/quantumlib/qsim/archive/refs/tags/v0.13.3.zip"],
37+
sha256 = "",
38+
strip_prefix = "qsim-0.15.0-dev20230327_v3",
39+
urls = ["https://github.com/jaeyoo/qsim/archive/refs/tags/v0.15.0+dev20230327_v3.tar.gz"],
3240
)
3341

3442
http_archive(
@@ -73,3 +81,21 @@ bind(
7381
actual = "@six_archive//:six",
7482
)
7583

84+
new_local_repository(
85+
name = "cuquantum_libs",
86+
path = "/usr/local/google/home/jaeyoo/workspace/cuquantum-linux-x86_64-22.11.0.13-archive",
87+
build_file_content = """
88+
cc_library(
89+
name = "custatevec_headers",
90+
srcs = ["include/custatevec.h"],
91+
visibility = ["//visibility:public"],
92+
)
93+
94+
cc_library(
95+
name = "custatevec",
96+
srcs = ["lib/libcustatevec.so"],
97+
visibility = ["//visibility:public"],
98+
)
99+
""",
100+
)
101+

benchmarks/scripts/benchmark_clifford_circuit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
"""Benchmark simulators against classically simulatable circuits."""
1616
import os
1717
import time

benchmarks/scripts/benchmark_op_gradients.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
"""Benchmark differentiator methods."""
1616
import os
1717
import time

benchmarks/scripts/benchmark_random_circuit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
"""Benchmark simulators against classically intractable 'supremacy' circuits."""
1616
import os
1717
import time

benchmarks/scripts/benchmark_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
"""Utility functions for benchmark tools."""
1616
import tensorflow as tf
1717
import test_log_pb2

benchmarks/scripts/benchmark_util_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
"""Tests for utilities related to reading/running benchmarks."""
1616
import os
1717
import tempfile

benchmarks/scripts/flags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
"""Command line flags shared between benchmarks."""
1616
from collections import namedtuple
1717
from absl import flags as absl_flags

benchmarks/scripts/flags_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
"""Tests for benchmark command line flags."""
1616

1717
import tensorflow as tf

benchmarks/scripts/models/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================

benchmarks/scripts/models/random_clifford_circuit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515

1616
from typing import Iterable
1717

benchmarks/scripts/models/random_clifford_circuit_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515

1616
from absl.testing import parameterized
1717
import cirq

configure.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
# ==============================================================================
15+
# =============================================================================
1616
PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
1717

1818
function write_to_bazelrc() {
@@ -62,11 +62,11 @@ while [[ "$TF_NEED_CUDA" == "" ]]; do
6262
done
6363

6464
while [[ "$TF_CUDA_VERSION" == "" ]]; do
65-
read -p "Are you building against TensorFlow 2.1(including RCs) or newer?[Y/n] " INPUT
65+
read -p "Are you building against TensorFlow 2.11(including RCs) or newer?[Y/n] " INPUT
6666
case $INPUT in
67-
[Yy]* ) echo "Build against TensorFlow 2.1 or newer."; TF_CUDA_VERSION=10.1;;
68-
[Nn]* ) echo "Build against TensorFlow <2.1."; TF_CUDA_VERSION=10.0;;
69-
"" ) echo "Build against TensorFlow 2.1 or newer."; TF_CUDA_VERSION=10.1;;
67+
[Yy]* ) echo "Build against TensorFlow 2.11 or newer."; TF_CUDA_VERSION=11;;
68+
[Nn]* ) echo "Build against TensorFlow <2.11."; TF_CUDA_VERSION=10.0;;
69+
"" ) echo "Build against TensorFlow 2.11 or newer."; TF_CUDA_VERSION=11;;
7070
* ) echo "Invalid selection: " $INPUT;;
7171
esac
7272
done
@@ -94,10 +94,6 @@ fi
9494
TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') )
9595
TF_LFLAGS="$(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))')"
9696

97-
write_to_bazelrc "build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true"
98-
if [[ "$PIP_MANYLINUX2010" == "0" ]]; then
99-
write_to_bazelrc "build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain"
100-
fi
10197

10298
write_to_bazelrc "build --experimental_repo_remote_exec"
10399
write_to_bazelrc "build --spawn_strategy=standalone"
@@ -142,8 +138,12 @@ fi
142138

143139
# TODO(yifeif): do not hardcode path
144140
if [[ "$TF_NEED_CUDA" == "1" ]]; then
141+
write_to_bazelrc "build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true"
142+
write_to_bazelrc "build:cuda --@local_config_cuda//:enable_cuda"
143+
write_to_bazelrc "build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain"
144+
145145
write_action_env_to_bazelrc "TF_CUDA_VERSION" ${TF_CUDA_VERSION}
146-
write_action_env_to_bazelrc "TF_CUDNN_VERSION" "7"
146+
write_action_env_to_bazelrc "TF_CUDNN_VERSION" "8"
147147
if is_windows; then
148148
write_action_env_to_bazelrc "CUDNN_INSTALL_PATH" "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${TF_CUDA_VERSION}"
149149
write_action_env_to_bazelrc "CUDA_TOOLKIT_PATH" "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${TF_CUDA_VERSION}"

docs/_book.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
upper_tabs:
1616
# Tabs left of dropdown menu
1717
- include: /_upper_tabs_left.yaml

docs/_index.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
book_path: /quantum/_book.yaml
1616
project_path: /quantum/_project.yaml
1717
description: >

docs/install.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ TensorFlow Quantum is supported on Python 3.7, 3.8, and 3.9 and depends directly
1717
### Requirements
1818

1919
* pip 19.0 or later (requires `manylinux2010` support)
20-
* [TensorFlow == 2.7.0](https://www.tensorflow.org/install/pip)
20+
* [TensorFlow == 2.11.0](https://www.tensorflow.org/install/pip)
2121

2222
See the [TensorFlow install guide](https://www.tensorflow.org/install/pip) to
2323
set up your Python development environment and an (optional) virtual environment.
@@ -27,7 +27,7 @@ Upgrade `pip` and install TensorFlow
2727
<!-- common_typos_disable -->
2828
<pre class="devsite-click-to-copy">
2929
<code class="devsite-terminal">pip3 install --upgrade pip</code>
30-
<code class="devsite-terminal">pip3 install tensorflow==2.7.0</code>
30+
<code class="devsite-terminal">pip3 install tensorflow==2.11.0</code>
3131
</pre>
3232
<!-- common_typos_enable -->
3333

@@ -84,21 +84,21 @@ 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.11.0. To ensure compatibility we use `bazel` version 5.1.0. To remove any existing version of Bazel:
87+
Our latest source builds use TensorFlow 2.11.0. To ensure compatibility we use `bazel` version 5.3.0. To remove any existing version of Bazel:
8888

8989
<!-- common_typos_disable -->
9090
<pre class="devsite-click-to-copy">
9191
<code class="devsite-terminal">sudo apt-get remove bazel</code>
9292
</pre>
9393
<!-- common_typos_enable -->
9494

95-
Download and install `bazel` version 5.1.0:
95+
Download and install `bazel` version 5.3.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/5.1.0/bazel_5.1.0-linux-x86_64.deb
99+
<code class="devsite-terminal">wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
100100
</code>
101-
<code class="devsite-terminal">sudo dpkg -i bazel_5.1.0-linux-x86_64.deb</code>
101+
<code class="devsite-terminal">sudo dpkg -i bazel_5.3.0-linux-x86_64.deb</code>
102102
</pre>
103103
<!-- common_typos_enable -->
104104

release/BUILD

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda_is_configured")
2+
13
licenses(["notice"])
24

35
sh_binary(
@@ -66,5 +68,8 @@ sh_binary(
6668
"//tensorflow_quantum/python:util",
6769
"//tensorflow_quantum/python/optimizers:rotosolve_minimizer",
6870
"//tensorflow_quantum/python/optimizers:spsa_minimizer",
69-
],
71+
] + if_cuda_is_configured([
72+
"//tensorflow_quantum/core/ops:tfq_simulate_ops_cuda_py",
73+
"//tensorflow_quantum/core/ops:tfq_simulate_ops_cuquantum_py",
74+
]),
7075
)

release/build_pip_package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
# ==============================================================================
15+
# =============================================================================
1616
set -e
1717
set -x
1818

release/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
"""TensorFlow Quantum adds qauntum computing primitives to TensorFlow.
1616
1717
TensorFlow Quantum is an open source library for high performance batch

scripts/benchmark_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
# ==============================================================================
15+
# =============================================================================
1616
echo "Testing benchmarks.";
1717
test_outputs=$(bazel test -c opt --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1" --cxxopt="-msse2" --cxxopt="-msse3" --cxxopt="-msse4" --test_output=errors $(bazel query //benchmarks/...))
1818
exit_code=$?

scripts/build_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
# ==============================================================================
14+
# =============================================================================
1515
"""Tool to generate external api_docs for tfq."""
1616

1717
from __future__ import absolute_import

scripts/build_pip_package_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
# ==============================================================================
15+
# =============================================================================
1616

1717
pip install -r requirements.txt
1818

scripts/ci_install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
# ==============================================================================
16-
wget https://github.com/bazelbuild/bazel/releases/download/5.1.0/bazel_5.1.0-linux-x86_64.deb
17-
sudo dpkg -i bazel_5.1.0-linux-x86_64.deb
15+
# =============================================================================
16+
wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
17+
sudo dpkg -i bazel_5.3.0-linux-x86_64.deb
1818
pip install --upgrade pip setuptools wheel
1919
pip install -r requirements.txt

scripts/ci_validate_tutorials.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
# ==============================================================================
15+
# =============================================================================
1616

1717
# Run the tutorials using the installed pip package
1818
pip install jupyter nbclient==0.6.5 jupyter-client==6.1.12 ipython==7.22.0

0 commit comments

Comments
 (0)