Proper response for testing lower bound on TensorFlow following protobuf ABI breaking change #1871
Replies: 2 comments
-
That's a good topic for thoughts! My take on this would tend to go for option 2, mainly to reduce technical debt. pyhf isn't brokenWhile it may sounds a bit strict as an argument, the problem clearly lies with TensorFlow and protobuf, not with pyhf. Strictly speaking, pyhf makes sure that pyhf runs with TensorFlow, but installing a running version of TensorFlow is not directly pyhf's responsibility. general argument on versionpyhf is in the 0.x development phase. This means it is not stable. It means that there are potentially bugs around that forces users to upgrade and "dropping" older versions seems like a reasonable choice. It's like saying that an older version had a major bug and cannot be used. different backendsAs pyhf supports many backends, users can not only upgrade TF (which anyways should be considered), but also use a different backends. This makes choosing an alternative backend and therefore avoiding the problem a lot easier. TF supported versionsThe actual question, IMHO, is whether one should support versions of libraries that are deemed unsupported by the library itself, as is the case for TF<2.6. I would say that the move of TF not to backport to older versions was somewhat foreseeable, as the backends, JAX and TF especially, are still undergoing changes (in zfit, using a lot more advanced features, we're even forced to clamp to 1 or 2 minor versions due to compatibility issues). Therefore, dropping explicit (as in "making sure they work flawlessly") support for older, unsupported backend versions may rather be considered the default overall. For the pyhf 1.x versionFor the stable release (but also for now), I would suggest to adapt a clear policy on this, i.e. that all the versions are supported of a backend that are supported by the library itself and mention it in a "backend" section. |
Beta Was this translation helpful? Give feedback.
-
Good points and ideas so far, just to throw in a few random thoughts: Someone stuck on an older version of anything is going to have to workaround issues if they don't fully pin, full stop. If you cap anything that is no longer supported, you are signing up to potentially run into issues, bugs, security issues, etc. So if someone is capping Second, placing a minimum here in PyHF will do nothing other than install an old version of PyHF to make this solve. You're not fixing the problem (forcing an tensorflow upgrade) if they've capped tensorflow, and it's not your problem, it's tensorflow's, so getting an old version of your library won't help. (Again, assuming no "upgrade one package in place" scenario here). If the cap is due to some other library, again, the solver will just pick an older PyHF. Anyway, on the other side, I'd generally argue that you should support only supported versions. It's a lot of extra technical debt to support unsupported versions of anything, and convincing a user to upgrade is likely easier than maintaining old support, and crippling the new features and optimizations you could otherwise add. Someone can always select an older PyHF if they are on an older tensorflow. Someone okay with an old tensorflow / python / etc should be okay with an older pyhf. Footnotes
|
Beta Was this translation helpful? Give feedback.
-
I'm hoping to have a bit of a community discussion RE: how I tried to respond in PR #1869 to
protobuf
v4.21.0
(now yanked — which is interesting) having ABI breaking changes that caused all releases of TensorFlow except for emergency patch releasesv2.6.5
,v2.7.3
,v2.8.2
, andv2.9.1
(which all cap the upper bound onprotobuf
to be'protobuf >= 3.9.2, < 3.2'
) to be broken at install (c.f. tensorflow/tensorflow#56077).In
pyhf
we empirically test all of the lower bounds insetup.cfg
andsetup.py
with a nightly CI workflow that uses aconstraints.txt
file to install the lower bound of all dependencies as we have defined them. Beforeprotobuf
v4.21.0
was released we hadpyhf/tests/constraints.txt
Lines 13 to 15 in 031218c
however, as a project TensorFlow only ported patch releases back to
v2.6.x
(c.f. Fixes are not always backported section of @henryiii's Should You Use Upper Bound Version Constraints? blog), and sotensorflow
v2.3.1
would be broken on install. We had two options:pyhf
backend, add an upper bound onprotobuf
in theconstraints.txt
file to keeptensorflow
v2.3.1
from breaking on install.v2.6.x
and set the lower bound ontensorflow
in thetensorflow
extra insetup.py
to betensorflow>=2.6.5
.This was PR #1869. We ended up going with option 1 after some discussion mainly because it would only affect the
pyhf
lower bound test suite and not make any changes for any future users.pyhf/tests/constraints.txt
Lines 13 to 16 in ea3249a
I can see arguments for both options 1 and 2 though, especially as now that TensorFlow has basically dropped support for anything pre-
v2.6.x
there is extra maintenance burden to supportv2.3.1
.pyhf
does not have anything that breaks thev2.3.x
API though, so there is no hard requirement from our useage oftensorflow
ortensorflow_probability
to make a change for API compatability. Though the It conflicts with tight lower bounds section of the blog seems to indicate that we wouldn't be the most terrible project if we kept tighter lower bounds then we currently do.I'm curious on what people in the Scikit-HEP community think is the appropriate thing to do here. If this was a project that you maintained, what actions would you take?
Things to note:
pyhf
backend is used extensively (compared to the JAX or PyTorch backends) so this may be more of an exercise in trying to adhere to best practices when it doesn't matter more than a situation in which we would actually affectpyhf
users very much.protobuf
actually gives some pretty good instructions to users. Here's what happens when you installtensorflow
v2.3.1
and (I have to force it as the release was yanked) the ABI incompatibleprotobuf
v4.21.0
.cc @kratsg @lukasheinrich @alexander-held @henryiii @agoose77 @jpivarski
Beta Was this translation helpful? Give feedback.
All reactions