diff options
| author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-03-25 19:00:22 +0000 |
|---|---|---|
| committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-03-25 20:30:46 +0000 |
| commit | 3a009bd5daf9e70546dcd5dc4b49450a15c5f34d (patch) | |
| tree | a2407dcd838ce6f32979978604c2faf85b2969fb | |
| parent | linux: 5.5.11 -> 5.5.13 (diff) | |
| parent | pythonPackages.tensorflow: disable for python2.7 and 3.8 (diff) | |
| download | nixpkgs-gitlab.intr/release-20.03.tar.gz | |
Merge branch 'tensorflow-versions' into release-20.03gitlab.intr/release-20.03
There were a number of fixes that were not backported. I made a branch
with those cherry-picked fixes to be merged into both 20.03 and master
(not changing master), to ensure the two release branches didn't diverge
when they shouldn't.
I like this "apply the fixes to the comment ancester and then merge
both" approach because it makes it much easier to avoid backporting
issues. I suspect I'll be making more fixes to both in the future.
| -rw-r--r-- | pkgs/development/python-modules/tensorflow/default.nix | 16 | ||||
| -rw-r--r-- | pkgs/development/python-modules/tensorflow/tf-1.15-bazel-1.0.patch | 213 |
2 files changed, 9 insertions, 220 deletions
diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index 81b61ee505c5..54629bebc116 100644 --- a/pkgs/development/python-modules/tensorflow/default.nix +++ b/pkgs/development/python-modules/tensorflow/default.nix @@ -1,7 +1,7 @@ -{ stdenv, pkgs, bazel_1, buildBazelPackage, lib, fetchFromGitHub, fetchpatch, symlinkJoin +{ stdenv, pkgs, bazel_0, buildBazelPackage, lib, fetchFromGitHub, fetchpatch, symlinkJoin , addOpenGLRunpath # Python deps -, buildPythonPackage, isPy3k, pythonOlder, pythonAtLeast, python +, buildPythonPackage, isPy3k, isPy27, pythonOlder, pythonAtLeast, python # Python libraries , numpy, tensorflow-tensorboard, backports_weakref, mock, enum34, absl-py , future, setuptools, wheel, keras-preprocessing, keras-applications, google-pasta @@ -94,7 +94,7 @@ let bazel-build = buildBazelPackage { name = "${pname}-${version}"; - bazel = bazel_1; + bazel = bazel_0; src = fetchFromGitHub { owner = "tensorflow"; @@ -121,7 +121,6 @@ let sha256 = "1n9ypbrx36fc1kc9cz5b3p9qhg15xxhq4nz6ap3hwqba535nakfz"; }) - ./tf-1.15-bazel-1.0.patch (fetchpatch { # be compatible with gast >0.2 instead of only gast 0.2.2 @@ -283,7 +282,6 @@ let bazelFlags = [ # temporary fixes to make the build work with bazel 0.27 "--incompatible_no_support_tools_in_action_inputs=false" - "--incompatible_use_native_patch=false" ]; bazelBuildFlags = [ "--config=opt" # optimize using the flags set in the configure phase @@ -297,9 +295,9 @@ let # cudaSupport causes fetch of ncclArchive, resulting in different hashes sha256 = if cudaSupport then - "05fx3jwgdh1nlr1kfy6w3mlbl5m8165lggcqgk5mpxx4kzicvr1y" + "1qygfcvvn9vysap9nk6xccxi9mgmzyxiywz6k456f811l1v70p2c" else - "0q0rwsb2yginqm6vv11zmbs7z2rdk7blyg5fk2jjkmkjrwzpazzg"; + "0kfjanw0mfbh30vi1ms2xlg8yp429cbyfriik6yxd5cla2pncg2j"; }; buildAttrs = { @@ -350,6 +348,7 @@ let in buildPythonPackage { inherit version pname; + disabled = isPy27 || (pythonAtLeast "3.8"); src = bazel-build.python; @@ -420,6 +419,9 @@ in buildPythonPackage { x = np.random.uniform(size=(1,1)) y = np.random.uniform(size=(1,)) model.fit(x, y, epochs=1) + + # regression test for #77626 + from tensorflow.contrib import tensor_forest EOF ''; diff --git a/pkgs/development/python-modules/tensorflow/tf-1.15-bazel-1.0.patch b/pkgs/development/python-modules/tensorflow/tf-1.15-bazel-1.0.patch deleted file mode 100644 index 4d70e99108bf..000000000000 --- a/pkgs/development/python-modules/tensorflow/tf-1.15-bazel-1.0.patch +++ /dev/null @@ -1,213 +0,0 @@ -diff --git a/tensorflow/c/BUILD b/tensorflow/c/BUILD -index f740ba66b5..6cc9003787 100644 ---- a/tensorflow/c/BUILD -+++ b/tensorflow/c/BUILD -@@ -270,6 +270,7 @@ tf_cuda_library( - "//tensorflow/core/platform", - "@com_google_absl//absl/strings", - ], -+ alwayslink = 1, - ) - - exports_files( -diff --git a/tensorflow/c/eager/BUILD b/tensorflow/c/eager/BUILD -index 5c42e508f7..16b421862c 100644 ---- a/tensorflow/c/eager/BUILD -+++ b/tensorflow/c/eager/BUILD -@@ -79,6 +79,7 @@ tf_cuda_library( - "//tensorflow/core/profiler/lib:profiler_session", - "//tensorflow/core:gpu_runtime", - ], -+ alwayslink = 1, - ) - - tf_cuda_library( -@@ -226,6 +227,7 @@ tf_cuda_library( - "//tensorflow/core/profiler/rpc/client:capture_profile", - "//tensorflow/core:gpu_runtime", - ], -+ alwayslink = 1, - ) - - tf_cuda_cc_test( -diff --git a/tensorflow/cc/saved_model/BUILD b/tensorflow/cc/saved_model/BUILD -index 39b84922d1..b2affdd999 100644 ---- a/tensorflow/cc/saved_model/BUILD -+++ b/tensorflow/cc/saved_model/BUILD -@@ -123,6 +123,7 @@ cc_library( - "//tensorflow/core/util/tensor_bundle:naming", - # mobile not supported yet - ]), -+ alwayslink = 1, - ) - - tf_cc_test( -diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD -index c23c1f9b39..805643b217 100644 ---- a/tensorflow/core/BUILD -+++ b/tensorflow/core/BUILD -@@ -777,6 +777,7 @@ cc_library( - ":lib_proto_parsing", - ":protos_all_cc", - ], -+ alwayslink = 1, - ) - - # DEPRECATED: use platform:stringpiece instead. -@@ -2496,6 +2497,7 @@ cc_library( - "@com_google_protobuf//:protobuf", - ] + tf_protos_all_impl() + tf_protos_grappler_impl() + - tf_additional_numa_deps(), -+ alwayslink = 1, - ) - - # File compiled with extra flags to get cpu-specific acceleration. -diff --git a/tensorflow/core/lib/random/BUILD b/tensorflow/core/lib/random/BUILD -index 3bd933261b..e1e589e76d 100644 ---- a/tensorflow/core/lib/random/BUILD -+++ b/tensorflow/core/lib/random/BUILD -@@ -50,6 +50,7 @@ cc_library( - "//tensorflow/core/platform:types", - "//third_party/eigen3", - ], -+ alwayslink = 1, - ) - - filegroup( -diff --git a/tensorflow/core/platform/default/build_config.bzl b/tensorflow/core/platform/default/build_config.bzl -index 5459d8d428..feba3a5686 100644 ---- a/tensorflow/core/platform/default/build_config.bzl -+++ b/tensorflow/core/platform/default/build_config.bzl -@@ -228,6 +228,7 @@ def cc_proto_library( - hdrs = gen_hdrs, - deps = cc_libs + deps, - includes = includes, -+ alwayslink = 1, - **kargs - ) - native.cc_library( -diff --git a/tensorflow/lite/java/src/test/native/BUILD b/tensorflow/lite/java/src/test/native/BUILD -index 6dcdab2aee..32bb0a8d85 100644 ---- a/tensorflow/lite/java/src/test/native/BUILD -+++ b/tensorflow/lite/java/src/test/native/BUILD -@@ -19,6 +19,7 @@ cc_library( - "//tensorflow/lite/java/jni", - "//tensorflow/lite/kernels:kernel_util", - ], -+ alwayslink = 1, - ) - - tflite_jni_binary( -diff --git a/tensorflow/lite/python/testdata/BUILD b/tensorflow/lite/python/testdata/BUILD -index 7bda81358f..ac1188d844 100644 ---- a/tensorflow/lite/python/testdata/BUILD -+++ b/tensorflow/lite/python/testdata/BUILD -@@ -60,6 +60,7 @@ cc_library( - deps = [ - "//tensorflow/lite/c:c_api_internal", - ], -+ alwayslink = 1, - ) - - cc_binary( -diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD -index 6fd9b4f273..29df3a3dff 100644 ---- a/tensorflow/python/BUILD -+++ b/tensorflow/python/BUILD -@@ -375,6 +375,7 @@ cc_library( - "//tensorflow/core:lib", - "//tensorflow/core:protos_all_cc", - ], -+ alwayslink = 1, - ) - - cc_library( -@@ -411,6 +412,7 @@ cc_library( - "//third_party/py/numpy:headers", - "//third_party/python_runtime:headers", - ], -+ alwayslink = 1, - ) - - cc_library( -@@ -617,6 +619,7 @@ cc_library( - "//tensorflow/core:op_gen_lib", - "//tensorflow/core:protos_all_cc", - ], -+ alwayslink = 1, - ) - - py_library( -diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl -index a3956322fe..32752f59ad 100644 ---- a/tensorflow/tensorflow.bzl -+++ b/tensorflow/tensorflow.bzl -@@ -2331,6 +2331,7 @@ def tf_generate_proto_text_sources(name, srcs_relative_dir, srcs, protodeps = [] - hdrs = out_hdrs, - visibility = visibility, - deps = deps, -+ alwayslink = 1, - ) - - def tf_genrule_cmd_append_to_srcs(to_append): -diff --git a/tensorflow/tools/graph_transforms/BUILD b/tensorflow/tools/graph_transforms/BUILD -index adafe2aca1..8965316b12 100644 ---- a/tensorflow/tools/graph_transforms/BUILD -+++ b/tensorflow/tools/graph_transforms/BUILD -@@ -223,6 +223,7 @@ cc_library( - "//tensorflow/core:lib_internal", - "//tensorflow/core:protos_all_cc", - ], -+ alwayslink = 1, - ) - - # This library includes a main function, to make it easy to create other -diff --git a/third_party/icu/data/BUILD.bazel b/third_party/icu/data/BUILD.bazel -index 7db21566e4..8e18c7cc3a 100644 ---- a/third_party/icu/data/BUILD.bazel -+++ b/third_party/icu/data/BUILD.bazel -@@ -43,4 +43,5 @@ cc_library( - name = "conversion_data", - srcs = [":conversion_data.c"], - deps = ["@icu//:headers"], -+ alwayslink = 1, - ) -diff --git a/third_party/protobuf/protobuf.patch b/third_party/protobuf/protobuf.patch -index df0648563d..18fc6cdf35 100644 ---- a/third_party/protobuf/protobuf.patch -+++ b/third_party/protobuf/protobuf.patch -@@ -11,7 +11,15 @@ index 2fb26050..c2744d5b 100644 - - ################################################################################ - # Protobuf Runtime Library --@@ -218,7 +218,7 @@ cc_library( -+@@ -209,6 +209,7 @@ cc_library( -+ copts = COPTS, -+ includes = ["src/"], -+ linkopts = LINK_OPTS, -++ alwayslink = 1, -+ visibility = ["//visibility:public"], -+ deps = [":protobuf_lite"] + PROTOBUF_DEPS, -+ ) -+@@ -219,7 +220,7 @@ cc_library( - # TODO(keveman): Remove this target once the support gets added to Bazel. - cc_library( - name = "protobuf_headers", -@@ -20,3 +28,4 @@ index 2fb26050..c2744d5b 100644 - includes = ["src/"], - visibility = ["//visibility:public"], - ) -+ -\ No newline at end of file -diff --git a/third_party/systemlibs/protobuf.bzl b/third_party/systemlibs/protobuf.bzl -index 774514f3fd..1c415b018b 100644 ---- a/third_party/systemlibs/protobuf.bzl -+++ b/third_party/systemlibs/protobuf.bzl -@@ -262,6 +262,7 @@ def cc_proto_library( - hdrs = gen_hdrs, - deps = cc_libs + deps, - includes = includes, -+ alwayslink = 1, - **kargs - ) - |
