Skip to content

Commit

Permalink
Merge pull request #69454 from jmillerpdt/bugfix/tensorflow-mkl
Browse files Browse the repository at this point in the history
pythonPackages.tensorflow: fix for bazel settings for intel mkl, dnnl
  • Loading branch information
Ericson2314 authored Mar 31, 2020
2 parents a90b82d + 4a4b448 commit be0d1dc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pkgs/development/python-modules/tensorflow/1/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# it would also make the default tensorflow package unfree. See
# https://groups.google.com/a/tensorflow.org/forum/#!topic/developers/iRCt5m4qUz0
, cudaSupport ? false, nvidia_x11 ? null, cudatoolkit ? null, cudnn ? null, nccl ? null
, mklSupport ? false, mkl ? null
# XLA without CUDA is broken
, xlaSupport ? cudaSupport
# Default from ./configure script
Expand All @@ -36,6 +37,8 @@ assert cudaSupport -> nvidia_x11 != null
# unsupported combination
assert ! (stdenv.isDarwin && cudaSupport);

assert mklSupport -> mkl != null;

let
withTensorboard = pythonOlder "3.6";

Expand Down Expand Up @@ -167,6 +170,8 @@ let
cudatoolkit
cudnn
nvidia_x11
] ++ lib.optionals mklSupport [
mkl
] ++ lib.optionals stdenv.isDarwin [
Foundation
Security
Expand Down Expand Up @@ -284,7 +289,8 @@ let
];
bazelBuildFlags = [
"--config=opt" # optimize using the flags set in the configure phase
];
]
++ lib.optionals (mklSupport) [ "--config=mkl" ];

bazelTarget = "//tensorflow/tools/pip_package:build_pip_package //tensorflow/tools/lib_package:libtensorflow";

Expand Down
8 changes: 7 additions & 1 deletion pkgs/development/python-modules/tensorflow/2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# it would also make the default tensorflow package unfree. See
# https://groups.google.com/a/tensorflow.org/forum/#!topic/developers/iRCt5m4qUz0
, cudaSupport ? false, nvidia_x11 ? null, cudatoolkit ? null, cudnn ? null, nccl ? null
, mklSupport ? false, mkl ? null
# XLA without CUDA is broken
, xlaSupport ? cudaSupport
# Default from ./configure script
Expand All @@ -36,6 +37,8 @@ assert cudaSupport -> nvidia_x11 != null
# unsupported combination
assert ! (stdenv.isDarwin && cudaSupport);

assert mklSupport -> mkl != null;

let
withTensorboard = pythonOlder "3.6";

Expand Down Expand Up @@ -163,6 +166,8 @@ let
cudatoolkit
cudnn
nvidia_x11
] ++ lib.optionals mklSupport [
mkl
] ++ lib.optionals stdenv.isDarwin [
Foundation
Security
Expand Down Expand Up @@ -278,7 +283,8 @@ let
];
bazelBuildFlags = [
"--config=opt" # optimize using the flags set in the configure phase
];
]
++ lib.optionals (mklSupport) [ "--config=mkl" ];

bazelTarget = "//tensorflow/tools/pip_package:build_pip_package //tensorflow/tools/lib_package:libtensorflow";

Expand Down

0 comments on commit be0d1dc

Please sign in to comment.