···
openMPISupport ? false, openmpi ? null,
7
-
numpy, pyyaml, cffi, click, typing, cmake, hypothesis, numactl, psutil,
8
-
linkFarm, symlinkJoin,
8
+
# Native build inputs
9
+
cmake, utillinux, linkFarm, symlinkJoin, which,
14
+
# Propagated build inputs
15
+
dataclasses, numpy, pyyaml, cffi, click, typing-extensions,
# virtual pkg that consistently instantiates blas across nixpkgs
# See https://github.com/NixOS/nixpkgs/pull/83888
···
# dependencies for torch.utils.tensorboard
pillow, six, future, tensorflow-tensorboard, protobuf,
20
-
utillinux, which, isPy3k }:
30
+
isPy3k, pythonOlder }:
assert !openMPISupport || openmpi != null;
···
in buildPythonPackage rec {
# Don't forget to update pytorch-bin to the same version.
···
120
-
sha256 = "14hhjsi6fnpaw9m1a3bhvdinsks6fhss6bbcrfk6jgns64abqdaz";
130
+
sha256 = "0hb11m5kvs4nsi5bc9ijnv6k07593p9dw40rcn33s9vspinrcjd4";
123
-
patches = lib.optionals stdenv.isAarch64 [
124
-
# GNU aarch64 assembler does not support 4s on neon mov:
125
-
# https://github.com/pytorch/pytorch/issues/33124
128
-
# https://github.com/pytorch/pytorch/pull/40584
130
-
# This patch can be removed with the next major version (1.7.0).
132
-
name = "qnnpack-neon-fix.patch";
133
-
url = "https://github.com/pytorch/pytorch/commit/7676682584d0caf9243bce74ea0a88711ec4a807.diff";
134
-
sha256 = "13spncaqlpsp8qk2850yly7xqwmhhfwznhmzkk8jgpslkbx75vgq";
136
-
] ++ lib.optionals stdenv.isDarwin [
133
+
patches = lib.optionals stdenv.isDarwin [
# pthreadpool added support for Grand Central Dispatch in April
# 2020. However, this relies on functionality (DISPATCH_APPLY_AUTO)
# that is available starting with macOS 10.13. However, our current
···
./pthreadpool-disable-gcd.diff
142
+
# The dataclasses module is included with Python >= 3.7. This should
143
+
# be fixed with the next PyTorch release.
145
+
substituteInPlace setup.py \
146
+
--replace "'dataclasses'" "'dataclasses; python_version < \"3.7\"'"
preConfigure = lib.optionalString cudaSupport ''
export TORCH_CUDA_ARCH_LIST="${lib.strings.concatStringsSep ";" final_cudaArchList}"
···
# the following are required for tensorboard support
pillow six future tensorflow-tensorboard protobuf
222
-
] ++ lib.optionals openMPISupport [ openmpi ];
227
+
] ++ lib.optionals openMPISupport [ openmpi ]
228
+
++ lib.optionals (pythonOlder "3.7") [ dataclasses ];
checkInputs = [ hypothesis ninja psutil ];