summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2021-04-11 15:22:13 +0100
committerGitHub <noreply@github.com>2021-04-11 15:22:13 +0100
commit57ae5de960bfd0a8f89ebeee71c522aeb59e2857 (patch)
tree45f551698279b6f32ab62742ee023389bf28e761
parent9ca28714c8b3dcd874ea5b5971e2eac244832d19 (diff)
parent0603c25738ab744f1ff61392bcea46055fb3b1b2 (diff)
downloadnixpkgs-57ae5de960bfd0a8f89ebeee71c522aeb59e2857.tar
nixpkgs-57ae5de960bfd0a8f89ebeee71c522aeb59e2857.tar.gz
nixpkgs-57ae5de960bfd0a8f89ebeee71c522aeb59e2857.tar.bz2
nixpkgs-57ae5de960bfd0a8f89ebeee71c522aeb59e2857.tar.lz
nixpkgs-57ae5de960bfd0a8f89ebeee71c522aeb59e2857.tar.xz
nixpkgs-57ae5de960bfd0a8f89ebeee71c522aeb59e2857.tar.zst
nixpkgs-57ae5de960bfd0a8f89ebeee71c522aeb59e2857.zip
Merge pull request #118964 from danieldk/pytorch-no-tests
python3Packages.pytorch: disable building of tests
-rw-r--r--pkgs/development/python-modules/pytorch/default.nix14
1 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/development/python-modules/pytorch/default.nix b/pkgs/development/python-modules/pytorch/default.nix
index 145c9a24075..1436153e1db 100644
--- a/pkgs/development/python-modules/pytorch/default.nix
+++ b/pkgs/development/python-modules/pytorch/default.nix
@@ -38,6 +38,7 @@ assert !(MPISupport && cudaSupport) || mpi.cudatoolkit == cudatoolkit;
 assert !cudaSupport || magma.cudatoolkit == cudatoolkit;
 
 let
+  setBool = v: if v then "1" else "0";
   cudatoolkit_joined = symlinkJoin {
     name = "${cudatoolkit.name}-unsplit";
     # nccl is here purely for semantic grouping it could be moved to nativeBuildInputs
@@ -160,16 +161,17 @@ in buildPythonPackage rec {
   # Use pytorch's custom configurations
   dontUseCmakeConfigure = true;
 
-  BUILD_NAMEDTENSOR = true;
-  BUILD_DOCS = buildDocs;
+  BUILD_NAMEDTENSOR = setBool true;
+  BUILD_DOCS = setBool buildDocs;
 
-  USE_MKL = blas.implementation == "mkl";
+  # We only do an imports check, so do not build tests either.
+  BUILD_TEST = setBool false;
 
   # Unlike MKL, oneDNN (née MKLDNN) is FOSS, so we enable support for
   # it by default. PyTorch currently uses its own vendored version
   # of oneDNN through Intel iDeep.
-  USE_MKLDNN = mklDnnSupport;
-  USE_MKLDNN_CBLAS = mklDnnSupport;
+  USE_MKLDNN = setBool mklDnnSupport;
+  USE_MKLDNN_CBLAS = setBool mklDnnSupport;
 
   preBuild = ''
     export MAX_JOBS=$NIX_BUILD_CORES
@@ -198,7 +200,7 @@ in buildPythonPackage rec {
   PYTORCH_BUILD_VERSION = version;
   PYTORCH_BUILD_NUMBER = 0;
 
-  USE_SYSTEM_NCCL=useSystemNccl;                  # don't build pytorch's third_party NCCL
+  USE_SYSTEM_NCCL=setBool useSystemNccl;                  # don't build pytorch's third_party NCCL
 
   # Suppress a weird warning in mkl-dnn, part of ideep in pytorch
   # (upstream seems to have fixed this in the wrong place?)