Conversation
There was a problem hiding this comment.
Code Review
This pull request updates TensorFlow Quantum to support TensorFlow 2.19.1 and TF-Keras 2.19.0, adjusting build configurations, documentation, and dependency management accordingly. Key changes include the enforcement of Python 3.10 for requirement generation and a migration from tensorflow::mutex to absl::Mutex in C++ core operations. Review feedback points out missing absl/synchronization/mutex.h headers and identifies a technical issue where absl::Mutex is stored in a std::vector, which is invalid due to its non-copyable and non-movable nature; a transition to std::unique_ptr is recommended.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the project to support TensorFlow 2.19.1 and TF-Keras 2.19.0. Key changes include updating dependency versions across README.md, WORKSPACE, setup.py, and requirement files, as well as updating installation documentation to include the TF_USE_LEGACY_KERAS=1 environment variable. In the C++ source, tensorflow::mutex has been replaced with absl::Mutex across multiple operation kernels. Furthermore, the generate_requirements.sh script now enforces Python 3.10 and utilizes updated pip-compile flags including hash generation. I have no feedback to provide as there were no review comments.
Summary
Update TensorFlow Quantum build to support TensorFlow 2.19.1.
Keep TFQ aligned with TensorFlow 2.19.1’s Bazel and Python repository expectations, confirm Eigen remains on TensorFlow’s pinned revision, and regenerate Python dependencies from
requirements.in.Key changes
WORKSPACE@org_tensorflowto2.19.1python_version_repoto satisfy TensorFlow 2.19’s expected Python version repository layoutrequirements_lock_3_10.txt,requirements_lock_3_11.txt,requirements_lock_3_12.txt) so the same compiled requirements can be reused across the supported Python versionsrequirements.in/requirements.txt2.19.1tf-kerasrequirement to2.19.xrequirements.txtfromrequirements.inwithpip-compileunder Python 3.10TFQ source compatibility
tensorflow::mutex, which fails with TensorFlow 2.19Docs / install flow
tf-keras==2.19.0andTF_USE_LEGACY_KERAS=1as part of the supported install pathTesting
Linux/Ubuntu 22.04 (Docker), Python 3.10, 3.11, and 3.12, Bazelisk → Bazel 6.5.0
bazel build ... release:build_pip_packagesucceeds./scripts/test_all.shand./scripts/ci_validate_tutorials.sh) pass2.19.1+tf-keras 2.19.0, Cirq1.5.0, and NumPy2.1.3Notes
2.20