Merge pull request #101917 from danieldk/pytorch-1.7.0
python3Packages.pytorch: 1.6.0 -> 1.7.0
This commit is contained in:
commit
5e93492b7f
@ -4,8 +4,18 @@
|
|||||||
openMPISupport ? false, openmpi ? null,
|
openMPISupport ? false, openmpi ? null,
|
||||||
buildDocs ? false,
|
buildDocs ? false,
|
||||||
cudaArchList ? null,
|
cudaArchList ? null,
|
||||||
numpy, pyyaml, cffi, click, typing, cmake, hypothesis, numactl, psutil,
|
|
||||||
linkFarm, symlinkJoin,
|
# Native build inputs
|
||||||
|
cmake, utillinux, linkFarm, symlinkJoin, which,
|
||||||
|
|
||||||
|
# Build inputs
|
||||||
|
numactl,
|
||||||
|
|
||||||
|
# Propagated build inputs
|
||||||
|
dataclasses, numpy, pyyaml, cffi, click, typing-extensions,
|
||||||
|
|
||||||
|
# Unit tests
|
||||||
|
hypothesis, psutil,
|
||||||
|
|
||||||
# virtual pkg that consistently instantiates blas across nixpkgs
|
# virtual pkg that consistently instantiates blas across nixpkgs
|
||||||
# See https://github.com/NixOS/nixpkgs/pull/83888
|
# See https://github.com/NixOS/nixpkgs/pull/83888
|
||||||
@ -17,7 +27,7 @@
|
|||||||
# dependencies for torch.utils.tensorboard
|
# dependencies for torch.utils.tensorboard
|
||||||
pillow, six, future, tensorflow-tensorboard, protobuf,
|
pillow, six, future, tensorflow-tensorboard, protobuf,
|
||||||
|
|
||||||
utillinux, which, isPy3k }:
|
isPy3k, pythonOlder }:
|
||||||
|
|
||||||
assert !openMPISupport || openmpi != null;
|
assert !openMPISupport || openmpi != null;
|
||||||
|
|
||||||
@ -102,7 +112,7 @@ let
|
|||||||
in buildPythonPackage rec {
|
in buildPythonPackage rec {
|
||||||
pname = "pytorch";
|
pname = "pytorch";
|
||||||
# Don't forget to update pytorch-bin to the same version.
|
# Don't forget to update pytorch-bin to the same version.
|
||||||
version = "1.6.0";
|
version = "1.7.0";
|
||||||
|
|
||||||
disabled = !isPy3k;
|
disabled = !isPy3k;
|
||||||
|
|
||||||
@ -117,23 +127,10 @@ in buildPythonPackage rec {
|
|||||||
repo = "pytorch";
|
repo = "pytorch";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
sha256 = "14hhjsi6fnpaw9m1a3bhvdinsks6fhss6bbcrfk6jgns64abqdaz";
|
sha256 = "0hb11m5kvs4nsi5bc9ijnv6k07593p9dw40rcn33s9vspinrcjd4";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = lib.optionals stdenv.isAarch64 [
|
patches = lib.optionals stdenv.isDarwin [
|
||||||
# GNU aarch64 assembler does not support 4s on neon mov:
|
|
||||||
# https://github.com/pytorch/pytorch/issues/33124
|
|
||||||
#
|
|
||||||
# Fix from:
|
|
||||||
# https://github.com/pytorch/pytorch/pull/40584
|
|
||||||
#
|
|
||||||
# This patch can be removed with the next major version (1.7.0).
|
|
||||||
(fetchpatch {
|
|
||||||
name = "qnnpack-neon-fix.patch";
|
|
||||||
url = "https://github.com/pytorch/pytorch/commit/7676682584d0caf9243bce74ea0a88711ec4a807.diff";
|
|
||||||
sha256 = "13spncaqlpsp8qk2850yly7xqwmhhfwznhmzkk8jgpslkbx75vgq";
|
|
||||||
})
|
|
||||||
] ++ lib.optionals stdenv.isDarwin [
|
|
||||||
# pthreadpool added support for Grand Central Dispatch in April
|
# pthreadpool added support for Grand Central Dispatch in April
|
||||||
# 2020. However, this relies on functionality (DISPATCH_APPLY_AUTO)
|
# 2020. However, this relies on functionality (DISPATCH_APPLY_AUTO)
|
||||||
# that is available starting with macOS 10.13. However, our current
|
# that is available starting with macOS 10.13. However, our current
|
||||||
@ -142,6 +139,13 @@ in buildPythonPackage rec {
|
|||||||
./pthreadpool-disable-gcd.diff
|
./pthreadpool-disable-gcd.diff
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# The dataclasses module is included with Python >= 3.7. This should
|
||||||
|
# be fixed with the next PyTorch release.
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace setup.py \
|
||||||
|
--replace "'dataclasses'" "'dataclasses; python_version < \"3.7\"'"
|
||||||
|
'';
|
||||||
|
|
||||||
preConfigure = lib.optionalString cudaSupport ''
|
preConfigure = lib.optionalString cudaSupport ''
|
||||||
export TORCH_CUDA_ARCH_LIST="${lib.strings.concatStringsSep ";" final_cudaArchList}"
|
export TORCH_CUDA_ARCH_LIST="${lib.strings.concatStringsSep ";" final_cudaArchList}"
|
||||||
export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
|
export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
|
||||||
@ -217,9 +221,11 @@ in buildPythonPackage rec {
|
|||||||
click
|
click
|
||||||
numpy
|
numpy
|
||||||
pyyaml
|
pyyaml
|
||||||
|
typing-extensions
|
||||||
# the following are required for tensorboard support
|
# the following are required for tensorboard support
|
||||||
pillow six future tensorflow-tensorboard protobuf
|
pillow six future tensorflow-tensorboard protobuf
|
||||||
] ++ lib.optionals openMPISupport [ openmpi ];
|
] ++ lib.optionals openMPISupport [ openmpi ]
|
||||||
|
++ lib.optionals (pythonOlder "3.7") [ dataclasses ];
|
||||||
|
|
||||||
checkInputs = [ hypothesis ninja psutil ];
|
checkInputs = [ hypothesis ninja psutil ];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user