diff options
author | lewo <lewo@abesis.fr> | 2018-05-15 08:40:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-15 08:40:51 +0200 |
commit | 640b6359ae316750f02c36f17557e4ed9ffcdf44 (patch) | |
tree | e7c1baf3a5a8c67fef4e4c3ff47eda84b420f0e8 /pkgs/development/python-modules | |
parent | 0e6fb50954bda292bc5108307ffe06c733815dca (diff) | |
parent | d2f7acf30c6dc1fe3a742f4035b11fe57514952b (diff) | |
download | nixlib-640b6359ae316750f02c36f17557e4ed9ffcdf44.tar nixlib-640b6359ae316750f02c36f17557e4ed9ffcdf44.tar.gz nixlib-640b6359ae316750f02c36f17557e4ed9ffcdf44.tar.bz2 nixlib-640b6359ae316750f02c36f17557e4ed9ffcdf44.tar.lz nixlib-640b6359ae316750f02c36f17557e4ed9ffcdf44.tar.xz nixlib-640b6359ae316750f02c36f17557e4ed9ffcdf44.tar.zst nixlib-640b6359ae316750f02c36f17557e4ed9ffcdf44.zip |
Merge pull request #40453 from andersk/pytorch
pytorch: 0.3.1 -> 0.4.0
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r-- | pkgs/development/python-modules/pytorch/default.nix | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/pkgs/development/python-modules/pytorch/default.nix b/pkgs/development/python-modules/pytorch/default.nix index c8376196d3ac..b0ac4e070935 100644 --- a/pkgs/development/python-modules/pytorch/default.nix +++ b/pkgs/development/python-modules/pytorch/default.nix @@ -1,7 +1,7 @@ -{ buildPythonPackage, +{ buildPythonPackage, pythonOlder, cudaSupport ? false, cudatoolkit ? null, cudnn ? null, - fetchFromGitHub, fetchpatch, lib, numpy, pyyaml, cffi, cmake, - git, stdenv, linkFarm, symlinkJoin, + fetchFromGitHub, fetchpatch, lib, numpy, pyyaml, cffi, typing, cmake, + stdenv, linkFarm, symlinkJoin, utillinux, which }: assert cudnn == null || cudatoolkit != null; @@ -25,7 +25,7 @@ let "LD_LIBRARY_PATH=${cudaStub}\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} "; in buildPythonPackage rec { - version = "0.3.1"; + version = "0.4.0"; pname = "pytorch"; name = "${pname}-${version}"; @@ -34,36 +34,17 @@ in buildPythonPackage rec { repo = "pytorch"; rev = "v${version}"; fetchSubmodules = true; - sha256 = "1k8fr97v5pf7rni5cr2pi21ixc3pdj3h3lkz28njbjbgkndh7mr3"; + sha256 = "12d5vqqaprk0igmih7fwa65ldmaawgijxl58h6dnw660wysc132j"; }; - patches = [ - (fetchpatch { - # make sure stdatomic.h is included when checking for ATOMIC_INT_LOCK_FREE - # Fixes this test failure: - # RuntimeError: refcounted file mapping not supported on your system at /tmp/nix-build-python3.6-pytorch-0.3.0.drv-0/source/torch/lib/TH/THAllocator.c:525 - url = "https://github.com/pytorch/pytorch/commit/502aaf39cf4a878f9e4f849e5f409573aa598aa9.patch"; - stripLen = 3; - extraPrefix = "torch/lib/"; - sha256 = "1miz4lhy3razjwcmhxqa4xmlcmhm65lqyin1czqczj8g16d3f62f"; - }) - ]; - - postPatch = '' - substituteInPlace test/run_test.sh --replace \ - "INIT_METHOD='file://'\$TEMP_DIR'/shared_init_file' \$PYCMD ./test_distributed.py" \ - "echo Skipped for Nix package" - ''; - preConfigure = lib.optionalString cudaSupport '' - export CC=${cudatoolkit.cc}/bin/gcc + export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++ '' + lib.optionalString (cudaSupport && cudnn != null) '' export CUDNN_INCLUDE_DIR=${cudnn}/include ''; buildInputs = [ cmake - git numpy.blas utillinux which @@ -73,10 +54,10 @@ in buildPythonPackage rec { cffi numpy pyyaml - ]; + ] ++ lib.optional (pythonOlder "3.5") typing; checkPhase = '' - ${cudaStubEnv}${stdenv.shell} test/run_test.sh + ${cudaStubEnv}python test/run_test.py --exclude distributed ''; meta = { |