Skip to content
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

pythonPackages.tensorflow: fix for bazel settings for intel mkl, dnnl #69454

Merged
merged 1 commit into from Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion pkgs/development/python-modules/tensorflow/1/default.nix
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
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