Skip to content

Conversation

@psamanoelton
Copy link
Collaborator

Summary

  • Update TensorFlow Quantum build to support TensorFlow 2.17.1.
  • Align Eigen with TensorFlow 2.17.1’s pinned revision to fix Tensor/Tensor.h build incompatibility.
  • Define essential requirements in requirements.in and use pip-compile to produce requirements.txt

Key changes

  • WORKSPACE:
    • bump @org_tensorflow to 2.17.1
    • add lightweight alias repo (pypi_setuptools) to satisfy TF’s @pypi_setuptools reference when rules_python generates @pypi__setuptools.
  • requirements.in:
    • set of requirements needed for building TFQ and running test scripts
    • requirements.txt is produced by running pip-compile --upgrade --generate-hashes -o requirements.txt requirements.in

Testing

  • Linux/Ubuntu 22.04 (Docker), Python 3.11, Bazelisk → Bazel 6.5.0
  • bazel build ... release:build_pip_package succeeds
  • Unit tests (scripts/test_all.sh & ./scripts/ci_validate_tutorials.sh) pass
  • Wheel installs and imports with TF 2.17.1 + tf-keras 2.17.0, Cirq 1.3.0, NumPy 1.26.4

Notes

  • This keeps TFQ on Keras 2 path; Keras 3 migration can be handled in a a future PR.
  • This changes will help on the incoming upgrades to 2.20.

@psamanoelton psamanoelton requested a review from mhucka January 14, 2026 20:56
Copy link
Member

@mhucka mhucka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had one question about Keras in the requirements, but otherwise, LGTM.

I just realized that this uses a slightly different way of generating requirements.txt. I will see if I can get MBB to review #945 today; in the meantime, can you try to generate requirements.txt using the script generate_requirements.sh in that PR? I think it will be merged soon, and so if this PR for 2.17 is merged afterwards, it will update the requirements using the same procedure, and nothing more will need to be done. (Conversely, if this is merged before the other PR, then we might have to regenerate the requirements using that script and do another PR just to update requirements.txt a 3rd time.)

tensorflow>=2.16,<2.17
tf-keras~=2.16.0
tensorflow>=2.17,<2.18
keras==3.12.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why does Keras need to be included here? Doesn't TensorFlow bring it in itself? Or is the problem getting a specific version of Keras?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the CI check using python 3.10 it has issues getting non specific version of Keras, it tried to get keras>3.13 and caused the issues in the CI checks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the CI check using python 3.10 it has issues getting non specific version of Keras, it tried to get keras>3.13 and caused the issues in the CI checks.

Oh, okay. Makes sense to pin it, then.

Thanks.

http_archive(
name = "eigen",
sha256 = "35ba771e30c735a4215ed784d7e032086cf89fe6622dce4d793c45dd74373362",
sha256 = "0992b93a590c39e196a9efdb5b4919fbf3fb485e7e656c6a87b21ddadb7f6ad2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the version of Eigen this corresponds to? (It'd be worth adding a comment about that. I find myself having to know the version number so that I can match it in qsim.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eigen 3.4.90 (development snapshot after 3.4.0)
pinned at commit c1d637433e3b3f9012b226c2c9125c494b470ae6

@mhucka
Copy link
Member

mhucka commented Jan 15, 2026

One last tiny request: could you make the title slightly more descriptive? E.g., spell out TensorFlow and say it's about supporting version 2.17. I don't mean to be picky – it's just to help make the commit history be clearer.

@psamanoelton psamanoelton changed the title Feature/tf217 support Add support for TensorFlow 2.17 Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants