Add support for TensorFlow 2.19#1051
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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 the Bazel workspace for multi-version Python support, adjusting dependency constraints in setup.py and requirements.in, and updating documentation to include the TF_USE_LEGACY_KERAS=1 environment variable. Additionally, the requirements generation script was refactored, and redundant mutex initializations in the C++ ops were removed. Feedback suggests restoring the pyyaml exclusion in generate_requirements.sh to prevent installation conflicts and explicitly setting the legacy Keras environment variable within the tutorial notebooks to ensure compatibility.
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
2.19.1tf-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