Skip to content

Update and diversify TensorFlow optional installations.#3292

Merged
MMathisLab merged 8 commits into
mainfrom
jaap/update_tf_extras
May 11, 2026
Merged

Update and diversify TensorFlow optional installations.#3292
MMathisLab merged 8 commits into
mainfrom
jaap/update_tf_extras

Conversation

@deruyter92

@deruyter92 deruyter92 commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

The current tensorflow installation via the optional extra tf is designed as a one-solution-for-all, instead of providing a tailored fit for multiple users with different machines. Also, there is divergence between the recommendations in the docs, CI and the current pyproject.toml. This PR implements a more diverse set of tensorflow installations, and aligns the CI so that these versions are actually tested. The documentation is also updated accordingly.

Addresses #3271

Optional dependencies

The new configuration is as follows:

  • tf: tensorflow>=2.12,<2.18 with all related dependencies -> recommended range that fits the documented last-supported versions and was tested on cuda 11.8 and cuda 12.0. Takes into account the installed python version.
  • tf-cu11 tensorflow==2.14 with all related dependencies -> for cuda 11.x machines.
  • tf-cu12 tensorflow==2.18 with all related dependences -> for cuda 12.x machines
  • tf-latest tensorflow>=2.18): 'best effort' support for users that prefer the latest installation (not tested).

CI

  • The separate hardcoded installation of TensorFlow is removed from CI and replaced with installing the tf extra.
  • The intelligent testing workflow now includes the option to specify custom extras for each job (turned out not to be necessary for tf, but still useful for the future).
  • A basic smoke test is implemented for just testing the tensorflow installation with some basic operations: tests/test_tf_install_smoke
  • The smoke test is hooked up to a job in intelligent-testing.yaml testing a matrix of os<>python<>extras. The job is purposely implemented in parallel to the existing lanes (e.g. full testing lane), as it doesn't need downloading ffmpeg etc.

Documentation

The documentation changes are now moved to a separate PR #3317.

@deruyter92 deruyter92 force-pushed the jaap/update_tf_extras branch from 91026e2 to 33126b8 Compare April 22, 2026 08:52
@C-Achard C-Achard self-requested a review April 22, 2026 08:57

@C-Achard C-Achard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks nice so far; thanks a lot for handling this! t

Two questions regarding the scope :

  • How should we handle documentation?
  • Can we have minimal CI testing that covers each of these paths ? What do you think would be the best method there ? Maybe a workflow only on main pushes that installs each and runs one of the lighter TF test script ?

@deruyter92

Copy link
Copy Markdown
Collaborator Author

yess working at it! good suggestions

@C-Achard

Copy link
Copy Markdown
Collaborator

For the docs happy to coordinate and add this to my ongoing updates!

@deruyter92 deruyter92 force-pushed the jaap/update_tf_extras branch 2 times, most recently from e198b38 to 42b2813 Compare April 22, 2026 15:51
@deruyter92

Copy link
Copy Markdown
Collaborator Author

Note: adding some smoke tests in CI, which I will probably move to a separate PR later to keep the discussions separated. But first want to test for compatible versioning.

I will also update the docs once finished and coordinate with you @C-Achard & help with the new docs to avoid parallel work.

@deruyter92 deruyter92 force-pushed the jaap/update_tf_extras branch from 285ba05 to 3f71887 Compare April 22, 2026 16:41
@C-Achard C-Achard linked an issue Apr 22, 2026 that may be closed by this pull request
@deruyter92 deruyter92 force-pushed the jaap/update_tf_extras branch 5 times, most recently from b7e27a1 to 527cf2f Compare April 24, 2026 14:17
@deruyter92 deruyter92 marked this pull request as ready for review April 28, 2026 08:57
@deruyter92 deruyter92 requested a review from C-Achard April 28, 2026 08:57
@deruyter92

Copy link
Copy Markdown
Collaborator Author

@C-Achard, it's ready for review now. Let me know what you think about the CI changes: for now I added a simple smoke test directly in the intelligent testing workflow, which means we can avoid (downloading and) installing ffmpeg for every run, and also doesn't affect the concurrency with the full-matrix tests. If you think it should make use of the python-package workflow, like the other test lanes, I can see arguments for that as well.

@C-Achard C-Achard added Installation Tensorflow 2 dependencies Pull requests that update a dependency file labels Apr 28, 2026
@deruyter92 deruyter92 force-pushed the jaap/update_tf_extras branch from 2a29eb6 to 527cf2f Compare May 4, 2026 20:24
Comment thread docs/installation.md

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we cherry-pick/adapt changes to the latest docs audit updates ?

@C-Achard

C-Achard commented May 5, 2026

Copy link
Copy Markdown
Collaborator

Seems tensorflow-macos is starting to fail in CI, perhaps we should make this high priority

Comment thread docs/gui/napari_GUI.md

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Note: this has already been replaced by #3280 and can be safely discarded I think

@C-Achard C-Achard mentioned this pull request May 5, 2026
8 tasks
@deruyter92 deruyter92 requested a review from AlexEMG May 6, 2026 08:58
@deruyter92 deruyter92 requested a review from MMathisLab May 6, 2026 08:58
@deruyter92 deruyter92 force-pushed the jaap/update_tf_extras branch from e5cea11 to 8c880cd Compare May 7, 2026 09:14
deruyter92 added 2 commits May 7, 2026 11:27
Xet is Hugging Face’s new storage backend designed to replace the aging Git LFS (Large File Storage). While Git LFS treats every file as a single "blob," Xet breaks files into small "chunks."

In restricted CI environments (like CircleCI, GCP, or Kaggle), the Xet "chunked" download often stalls. Because Xet opens many simultaneous connections to different data chunks, CI firewalls or NAT gateways sometimes flag this as suspicious activity or simply drop the connections when they hit a certain threshold.
@deruyter92

Copy link
Copy Markdown
Collaborator Author

Cleaned up this PR and fixed failing tests:

@MMathisLab MMathisLab merged commit 85569cb into main May 11, 2026
31 checks passed
@MMathisLab MMathisLab deleted the jaap/update_tf_extras branch May 11, 2026 20:28
@deruyter92 deruyter92 mentioned this pull request May 21, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file high-priority Installation Tensorflow 2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diversify optional installs for TensorFlow stack (LTS)

3 participants