scikit-hep / pyhf

pure-Python HistFactory implementation with tensors and autodiff
https://pyhf.readthedocs.io/
Apache License 2.0
283 stars 83 forks source link

Switch to using 'tensorflow' for Apple silicon Macs for TensorFlow v2.16.1+ #2449

Closed matthewfeickert closed 6 months ago

matthewfeickert commented 6 months ago

As noted in PR #2448, the tensorflow v2.16.1 release notes mention:

  • Apple Silicon users: If you previously installed TensorFlow using pip install tensorflow-macos, please update your installation method. Use pip install tensorflow from now on.

  • Mac x86 users: Mac x86 builds are being deprecated and will no longer be released as a Pip package from TF 2.17 onwards.

This will require an effective revert of PR https://github.com/scikit-hep/pyhf/pull/2119 with the removal of

https://github.com/scikit-hep/pyhf/blob/af5d9521b1a3f1e307ecef2c23d9a418994394b9/pyproject.toml#L74

once tensorflow-probability supports Keras v3.0 and PR #2448 can be reverted.

matthewfeickert commented 6 months ago

cc @alexander-held as a bit of a heads up, though no action is needed now.

matthewfeickert commented 6 months ago

We should also apparently be using tensorflow-probability extra to use tensorflow with tensorflow-probability.

https://github.com/tensorflow/probability/pull/1796

So

https://github.com/scikit-hep/pyhf/blob/af5d9521b1a3f1e307ecef2c23d9a418994394b9/pyproject.toml#L72-L76

can get reduced to just

tensorflow = ["tensorflow-probability[tf]>=0.24.0"]

or whatever the next release of tensorflow-probability is after v0.23.0 that includes https://github.com/tensorflow/probability/commit/988f02323f16419086d761cc6cdd50b94aa03257 in it.