-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python.pkgs.tensorflow: 1.15.0 -> 2.0.0 #70910
Conversation
If users need 1.14 they can take it from an older Nixpkgs. |
Please keep 1.14/1.15 around for a while! A lot of users cannot switch to TF 2.0's compat mode, they completely dropped Upstream will soon release 1.15 and they will provide security updates for another year: Edit: just wanted to add: I would think that for most folks who are still stuck on 1.x, having |
Why is that? If I understand the release notes correctly (I haven't tested this yet) you should be able to just set the environment variable Keeping multiple versions with python is not simple, since the python interpreter will not be able to deal with different versions. Also there would need to be duplicates for all reverse deps etc. |
As I mentioned, TF 2.0 with compat does not have
https://www.tensorflow.org/guide/migrate We are currently migrating code to Tensorflow 2.0, but it will take a while before all the contrib functionality is rewritten.
I am not sure if I understand. If we had a 1.14 bin version besides 2.0 bin/Bazel versions, that would be fine as long as people do not use both packages at the same time, right?
Don't 1.14/2.0 largely share the same dependencies? |
135c5a4
to
b79b3a1
Compare
Ah right, I seem to have misunderstood. So tf 1.15 can work as tf1 or tf2 while tf 2.0.0 can only work as tf2. But tf 1.15 still won't be able to execute tf 2.0 entirely without modification since you need to actively enable the tf2 features. What a mess. So in that case its probably best to wait for 1.15 to be released (currently in rc3) and ship that first. Then maybe after a month or two, when the core infrastructure had time to adapt (for example sonnet 2.0 is still in beta) do the 2.0 update. |
Yea, i would hold off on bumping this..... that data science community needs some time... |
b79b3a1
to
a4afb75
Compare
1.15.0 has been released. The update is in #71282, I'll keep this open as a WIP for the eventual 2.0 update. |
… 1.15.0 -> 2.0.0 Major breaking change.
a4afb75
to
d59b4d0
Compare
tensorflow 2.0.0 works now (with bazel 1.19). So from a technical point of view this is ready. Any strong opinions on when to merge this? |
When most of the downstream packages have had time to bump to tensorflow 2. I would almost be willing to make an exception to the "only 1 package version for python". This package is pretty much impossible to get without significant effort, for nixos users who need tensorflow<2, they will have a difficult time. |
Also, tensorflow 1.15 contains an implementation of both v1 and v2 APIs, so I think this is the correct version to have during this transition period |
Also, I think Tensorflow 2.0 does not provide a C library yet:
https://www.tensorflow.org/install/lang_c Which means that the graphs created with Tensorflow 2.0 (in contrast to v2 compat in 1.15.0) cannot be used with some bindings yet (eg. the Rust binding uses libtensorflow). |
Well as @FRidh suggested, its always possible to take it from an earlier nixpkgs. Since 1.15.0 is in the channels now, that should be as easy as let
tf1_pkgs = let
nixpkgs-rev = "e89b21504f3e61e535229afa0b121defb52d2a50"; # nixos-unstable from 2019-11-20
in import (builtins.fetchTarball {
name = "nixpkgs-${nixpkgs-rev}";
url = "https://github.com/nixos/nixpkgs/archive/${nixpkgs-rev}.tar.gz";
}) {};
in
something |
I'm not sure if it is worth it. The pinning experience is not that horrible (especially if you use a
Is anyone aware of packages in nixpkgs that actually still have a hard dependency on tf1? |
As far as I know the Haskell tensorflow package, because it requires |
there's a few python packages: |
|
tensorflow-haskell hasn't seen much love lately. There doesn't appear to be anyone working on even updating it for tensorflow-1.15. We shouldn't use tensorflow-haskell as a reason to keep back tensorflow-2. |
@cdepillabout agreed. My point was more to illustrate the ecosystem around tensorflow is largely in disarray with the switch. This is only amplified with how many resources are invested in developing ML models. There's a large resistance to upgrade just because a new version is out. |
Yeah I would think it's fine to have |
what is blocking the merge now? is there anything I can help with? |
If we document a way to get tensorflow_1, then I'm fine with merging. Still unfortunate about the major breakage |
There are some other special cases where we do this, e.g. Django. |
We should probably get this in before the feature freeze tomorrow |
Agreed! I think the same counts for |
For the plain update, this should be good to go IIRC. My time is pretty limited right now, so I'll not be working on this before the branchoff. Merge / fork off at your own discretion. |
seems that the branch off has been delayed a bit. |
Well, the current build is broken, I don't see any harm in merging this |
@GrahamcOfBorg build python3Packages.tensorflow |
There are current PRs that will depend on having a packaged TF 1 variant due to the sunsetting of contrib, see #61253 |
Which currently does not work, because neither These things are only going to get worse as the ecosystem moves on and Google loses interest to maintain the 1.15 branch. I think at this point, it makes most sense to switch to Tensorflow 2, since that is what most people will expect now and is required by various high-profile projects (e.g. Hugging Face transformers). Tensorflow 1.15 and projects that rely on it could always be packaged in NUR. Random observation: a lot of these packages are quite high-friction. I have started packaging my own PyTorch because the nixpkgs version is usually trailing quite a bit. Also, the libtorch C++ API breaks between releases, so we always have to cherry pick releases that line up with the I wonder if these packages belong in nixpkgs, rather than a specialized NUR repository. PyTorch and Tensorflow, probably, because people expect to be able to fire up a Jupyter notebook and experiment. But if they are always going to be held back because they are moving fast and updating them breaks other derivations in nixpkgs, we'd always be shipping ancient Tensorflow and PyTorch versions. |
Ha true, but once my PR's get merged they will! I agree with you in principal (I have migrated all of my active projects to tf2) however, several libraries like Sonnet 1, Deepmind's graph neural network library (the name escapes me), Deeplabcut, all depend on tf1 and are unlikely to be updated. I also have a PR for adding a configurable bazel build with bazel 1 #81033, so I don't see the harm in having a legacy tensorflow implementation, we could even add a separate tensorflow_1 derivation. |
That was my initial suggestion, but this is probably not a good idea as discussed upthread. The objection is that this could result in closures that contain two versions of Tensorflow, which conflict in Python. |
Hm, is there some workaround for applications? The PR that @mjlbach referenced would be of high use to the scientific community. Deeplabcut has been used in dozens or more high profile papers, and popularity is only increasing. Unfortunately the package is a PITA to install and neither conda nor docker are fully functional due to various restrictions. Nix would really shine here, and it’s a gateway to growing nix datascience community. TF1 vs TF2 is more analogous to Python 2 vs Python 3 than a typical package update. There’s a huge ecosystem dependent on tf1 that is not switching in the foreseeable future. |
I am currently rebasing this to be a new additional version rather than replacement. |
related: #83518 |
We've landed the 2.1 change. |
Can someone explain the differences and equivalences? In TF1, I used Now with TF2, what is the equivalent here? I see:
What translates to the "CUDA" and non-CUDA variant? Also:
I see that 2.2 is not yet in nixpkgs. |
be the change you want to see :) |
@CMCDragonkai |
Motivation for this change
Tensorflow 2.0 was released. This is WIP. The only testing I did for now was to build the py3, non-cuda variant on aarch64 using the community builder. Things to do: