Skip to content

Commit

Permalink
Roll back to working state. (#780)
Browse files Browse the repository at this point in the history
* Revert "Merge pull request #776 from Sinestro38/master"

This reverts commit b4c7ea1, reversing
changes made to 140277d.

* Revert "remove release notes md"

This reverts commit 25313f4.

* Revert "Merge remote-tracking branch 'forkB/fix_warnings'"

This reverts commit d789314, reversing
changes made to fe3a96e.

* Revert "Merge pull request #772 from Sinestro38/fix_license"

This reverts commit 140277d, reversing
changes made to 7131f9e.

* Revert "fix ubuntu version to 20.04"

This reverts commit 803622a.

* Revert "[debug] get ubuntu  version of runner"

This reverts commit 8002690.

* Revert "update ubuntu github runner from 18.04 to latest"

This reverts commit 471573a.

* Revert "update > to ~"

This reverts commit fe3a96e.

* Revert "update cirq dependency news"

This reverts commit a44ab26.

* Revert "Update release.md"

This reverts commit a7a67c8.

* Revert "add notes"

This reverts commit c7f729a.

* Revert "update version num"

This reverts commit f933b69.

* Revert "Update release.md"

This reverts commit c2ab0d5.

* Revert "Create release.md"

This reverts commit ac7722a.

* Revert "Merge branch 'master' into master"

This reverts commit 7131f9e, reversing
changes made to 2c1e7fa.

* Revert "Upgrade bazel version 5.3.0 and fix some typo in tf version (#755)"

This reverts commit 2c1e7fa.

* Revert "Merge pull request #3 from jaeyoo/pavan/remove_compute_small"

This reverts commit 79aae25, reversing
changes made to 46aa1f0.

* Revert "Fix lint"

This reverts commit 20815bc.

* Revert "Fix lint"

This reverts commit 47e6aae.

* Revert "Update release/BUILD with `if_cuda_is_configured`"

This reverts commit f2cd255.

* Revert "add :tfq_simulate_ops_cuquantum_py target to release BUILD"

This reverts commit 3e8a9a4.

* Revert "remove computeSmall from cuda and cuquantum kernels"

This reverts commit 5cb7fa1.

* Revert "Merge pull request #2 from jaeyoo/cuquantum_support"

This reverts commit 46aa1f0, reversing
changes made to 2a5fd07.

* Revert "Merge pull request #1 from jaeyoo/cuda_support"

This reverts commit 2a5fd07, reversing
changes made to b0dd745.

* Revert "Merge branch 'master' into cuda_support"

This reverts commit f19298c, reversing
changes made to 4f6290a.

* Revert "Add cuQuantum test (but failed at numeric diff test)"

This reverts commit f97c496.

* Revert "Fix ComputeSmall and enable it."

This reverts commit 4f6290a.

* Revert "Fix tfq_simulate_ops_cuda op test."

This reverts commit 6644248.

* Revert "Temporarily turn on ComputeLarge always"

This reverts commit 23dd880.

* Revert "Upgrade TF version from 2.7 to 2.11 (#749)"

This reverts commit 20cfde5.

* Revert "TFQ simulate expectation CUDA op"

This reverts commit f063417.

* Revert "Update ci_install bazel version, removed duplicated code lines."

This reverts commit 1317edf.

* Revert "Fix typo"

This reverts commit a765f7f.

* Revert "Upgrade seaborn version to 0.12.0"

This reverts commit 4e7c22d.

* Revert "Fix tutorial errors"

This reverts commit c185891.

* Revert "Fix tutorial error"

This reverts commit c5df061.

* Revert "Upgrade the latest gym for notebook tutorial."

This reverts commit 9b94ebf.

* Revert "Format optimizers"

This reverts commit 39a811d.

* Revert "Format"

This reverts commit a22b98f.

* Revert "Upgrade to TF v2.11"

This reverts commit 26fa2df.

* Upgrade TF version from 2.7 to 2.11 (#749)

* Upgrade bazel version to 5.1.0 for building with TFv2.11.0

* Upgrade to TF v2.11

* Bump up the version of numpy to v1.24.2

* Format

* Fix tf.Variable inside tf.while_loop issues inside optimizers

* Format optimizers

* Upgrade the latest gym for notebook tutorial.

* Fix tutorial error

* Fix tutorial errors

* Upgrade seaborn version to 0.12.0

* Fix typo

* Remove debug print

* Update ci_install bazel version, removed duplicated code lines.

* Upgrade bazel version 5.3.0 and fix some typo in tf version (#755)

* fix compatability issues.

* re-trigger kokoro

* re-trigger kokoro

* re-trigger kokoro

* re-trigger kokoro

* re-trigger kokoro

* Lower tolerances.

* Bump CI python version.

---------

Co-authored-by: Jae H. Yoo <[email protected]>
  • Loading branch information
MichaelBroughton and jaeyoo authored Jul 5, 2023
1 parent b4c7ea1 commit f56257b
Show file tree
Hide file tree
Showing 156 changed files with 310 additions and 1,291 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Continuous Integration

on: [pull_request]


jobs:
lint:
name: Lint check
Expand All @@ -10,7 +11,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.8'
python-version: '3.9'
architecture: 'x64'
- name: Install Lint tools
run: pip install --upgrade pip setuptools; pip install -r requirements.txt;
Expand All @@ -25,7 +26,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.8'
python-version: '3.9'
architecture: 'x64'
- name: Install Format tools
run: pip install --upgrade pip setuptools; pip install -r requirements.txt; sudo apt-get install -y clang-format-6.0
Expand All @@ -40,7 +41,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.8'
python-version: '3.9'
architecture: 'x64'
- name: Install Bazel on CI
run: ./scripts/ci_install.sh
Expand All @@ -60,7 +61,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.8'
python-version: '3.9'
architecture: 'x64'
- name: Install Bazel on CI
run: ./scripts/ci_install.sh
Expand All @@ -78,7 +79,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.8'
python-version: '3.9'
architecture: 'x64'
- name: Install Bazel on CI
run: ./scripts/ci_install.sh
Expand All @@ -96,7 +97,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.8'
python-version: '3.9'
architecture: 'x64'
- name: Install notebook dependencies
run: pip install --upgrade pip seaborn==0.10.0
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/cirq_compatibility.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Cirq Compatibility

on:
Expand All @@ -8,7 +7,7 @@ on:
jobs:
consistency:
name: Nightly Compatibility
runs-on: ubuntu-20.04
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
Expand Down
32 changes: 3 additions & 29 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,11 @@ cc_library(
],
)

# http_archive(
# name = "qsim",
# sha256 = "b9c1eba09a885a938b5e73dfc2e02f5231cf3b01d899415caa24769346a731d5",
# strip_prefix = "qsim-0.13.3",
# urls = ["https://github.com/quantumlib/qsim/archive/refs/tags/v0.13.3.zip"],
# )

# TODO: After merging this patch later into qsim mainstream, remove this and uncomment the above.
http_archive(
name = "qsim",
sha256 = "",
strip_prefix = "qsim-0.15.0-dev20230327_v3",
urls = ["https://github.com/jaeyoo/qsim/archive/refs/tags/v0.15.0+dev20230327_v3.tar.gz"],
sha256 = "b9c1eba09a885a938b5e73dfc2e02f5231cf3b01d899415caa24769346a731d5",
strip_prefix = "qsim-0.13.3",
urls = ["https://github.com/quantumlib/qsim/archive/refs/tags/v0.13.3.zip"],
)

http_archive(
Expand Down Expand Up @@ -81,21 +73,3 @@ bind(
actual = "@six_archive//:six",
)

new_local_repository(
name = "cuquantum_libs",
path = "/usr/local/google/home/jaeyoo/workspace/cuquantum-linux-x86_64-22.11.0.13-archive",
build_file_content = """
cc_library(
name = "custatevec_headers",
srcs = ["include/custatevec.h"],
visibility = ["//visibility:public"],
)
cc_library(
name = "custatevec",
srcs = ["lib/libcustatevec.so"],
visibility = ["//visibility:public"],
)
""",
)

2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_clifford_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""Benchmark simulators against classically simulatable circuits."""
import os
import time
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_op_gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""Benchmark differentiator methods."""
import os
import time
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_random_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""Benchmark simulators against classically intractable 'supremacy' circuits."""
import os
import time
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""Utility functions for benchmark tools."""
import tensorflow as tf
import test_log_pb2
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/benchmark_util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""Tests for utilities related to reading/running benchmarks."""
import os
import tempfile
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""Command line flags shared between benchmarks."""
from collections import namedtuple
from absl import flags as absl_flags
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/flags_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""Tests for benchmark command line flags."""

import tensorflow as tf
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
2 changes: 1 addition & 1 deletion benchmarks/scripts/models/random_clifford_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================

from typing import Iterable

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/scripts/models/random_clifford_circuit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================

from absl.testing import parameterized
import cirq
Expand Down
10 changes: 5 additions & 5 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"

function write_to_bazelrc() {
Expand Down Expand Up @@ -62,11 +62,11 @@ while [[ "$TF_NEED_CUDA" == "" ]]; do
done

while [[ "$TF_CUDA_VERSION" == "" ]]; do
read -p "Are you building against TensorFlow 2.11(including RCs) or newer?[Y/n] " INPUT
read -p "Are you building against TensorFlow 2.1(including RCs) or newer?[Y/n] " INPUT
case $INPUT in
[Yy]* ) echo "Build against TensorFlow 2.11 or newer."; TF_CUDA_VERSION=11;;
[Nn]* ) echo "Build against TensorFlow <2.11."; TF_CUDA_VERSION=10.0;;
"" ) echo "Build against TensorFlow 2.11 or newer."; TF_CUDA_VERSION=11;;
[Yy]* ) echo "Build against TensorFlow 2.1 or newer."; TF_CUDA_VERSION=11;;
[Nn]* ) echo "Build against TensorFlow <2.1."; TF_CUDA_VERSION=10.0;;
"" ) echo "Build against TensorFlow 2.1 or newer."; TF_CUDA_VERSION=11;;
* ) echo "Invalid selection: " $INPUT;;
esac
done
Expand Down
2 changes: 1 addition & 1 deletion docs/_book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
upper_tabs:
# Tabs left of dropdown menu
- include: /_upper_tabs_left.yaml
Expand Down
2 changes: 1 addition & 1 deletion docs/_index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
book_path: /quantum/_book.yaml
project_path: /quantum/_project.yaml
description: >
Expand Down
7 changes: 1 addition & 6 deletions release/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda_is_configured")

licenses(["notice"])

sh_binary(
Expand Down Expand Up @@ -68,8 +66,5 @@ sh_binary(
"//tensorflow_quantum/python:util",
"//tensorflow_quantum/python/optimizers:rotosolve_minimizer",
"//tensorflow_quantum/python/optimizers:spsa_minimizer",
] + if_cuda_is_configured([
"//tensorflow_quantum/core/ops:tfq_simulate_ops_cuda_py",
"//tensorflow_quantum/core/ops:tfq_simulate_ops_cuquantum_py",
]),
],
)
2 changes: 1 addition & 1 deletion release/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
set -e
set -x

Expand Down
4 changes: 2 additions & 2 deletions release/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""TensorFlow Quantum adds qauntum computing primitives to TensorFlow.
TensorFlow Quantum is an open source library for high performance batch
Expand Down Expand Up @@ -53,7 +53,7 @@ def finalize_options(self):
REQUIRED_PACKAGES = [
'cirq-core==0.13.1', 'cirq-google>=0.13.1', 'sympy == 1.8',
'googleapis-common-protos==1.52.0', 'google-api-core==1.21.0',
'google-auth==1.18.0', 'protobuf==3.19.5'
'google-auth==1.18.0', 'protobuf==3.19.4'
]

# placed as extra to not have required overwrite existing nightly installs if
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ google-api-core==1.21.0
google-auth==1.18.0
google-api-python-client==1.8.0
grpcio==1.34.1
protobuf==3.19.5
protobuf==3.19.4
2 changes: 1 addition & 1 deletion scripts/benchmark_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
echo "Testing benchmarks.";
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/...))
exit_code=$?
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""Tool to generate external api_docs for tfq."""

from __future__ import absolute_import
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_pip_package_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================

pip install -r requirements.txt

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
sudo dpkg -i bazel_5.3.0-linux-x86_64.deb
pip install --upgrade pip setuptools wheel
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci_validate_tutorials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================

# Run the tutorials using the installed pip package
pip install jupyter nbclient==0.6.5 jupyter-client==6.1.12 ipython==7.22.0
Expand Down
4 changes: 2 additions & 2 deletions scripts/format_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
echo "Doing python language formatting..."
python3 -m yapf --style=google --in-place --recursive ./benchmarks
python3 -m yapf --style=google --in-place --recursive ./tensorflow_quantum
echo -e "Done! \nDoing notebook formatting..."
python3 ./scripts/format_ipynb.py
echo -e "Done! \nDoing C++ formatting..."
find tensorflow_quantum/ -iname *.h -o -iname *.cc | xargs clang-format-6.0 -i -style=google
find tensorflow_quantum/ -iname *.h -o -iname *.cc | xargs clang-format -i -style=google
echo "Done!"
exit 0;
4 changes: 2 additions & 2 deletions scripts/format_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
echo "Checking python formatting...";

################################################################################
Expand Down Expand Up @@ -92,7 +92,7 @@ else
fi

echo "Checking C++ formatting...";
formatting_outputs=$(find tensorflow_quantum/ -iname *.h -o -iname *.cc | xargs clang-format-6.0 -style=google -output-replacements-xml);
formatting_outputs=$(find tensorflow_quantum/ -iname *.h -o -iname *.cc | xargs clang-format -style=google -output-replacements-xml);
CFORMATCHECK=0
while read -r formatting_outputs; do
if [ "$formatting_outputs" != "<?xml version='1.0'?>" ] && [ "$formatting_outputs" != "<replacements xml:space='preserve' incomplete_format='false'>" ] && [ "$formatting_outputs" != "</replacements>" ] && [ "$formatting_outputs" != "<replacement offset='4290' length='9'> </replacement>" ]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/format_ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""Format notebook code cells using yapf google style."""
import glob
import nbformat
Expand Down
2 changes: 1 addition & 1 deletion scripts/import_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =============================================================================
# ==============================================================================
"""Tests to check if importing `tfq` APIs is successful or not."""
import tensorflow_quantum as tfq

Expand Down
Loading

0 comments on commit f56257b

Please sign in to comment.