From 207b16af90cda99f640a75f64a6e16b755a44062 Mon Sep 17 00:00:00 2001 From: Junji Hashimoto Date: Wed, 10 Nov 2021 00:25:41 +0000 Subject: [PATCH] python3Packages.pytorch-bin: 1.9.1 -> 1.10.0 --- .../python-modules/pytorch/bin.nix | 10 ++++++++-- .../python-modules/pytorch/binary-hashes.nix | 20 +++++++++---------- .../python-modules/pytorch/prefetch.sh | 13 ++++++------ 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/pytorch/bin.nix b/pkgs/development/python-modules/pytorch/bin.nix index e9bc58321df5..f570a0a5c95a 100644 --- a/pkgs/development/python-modules/pytorch/bin.nix +++ b/pkgs/development/python-modules/pytorch/bin.nix @@ -18,7 +18,7 @@ let pyVerNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion; srcs = import ./binary-hashes.nix version; unsupported = throw "Unsupported system"; - version = "1.9.1"; + version = "1.10.0"; in buildPythonPackage { inherit version; @@ -59,13 +59,19 @@ in buildPythonPackage { done ''; + # The wheel-binary is not stripped to avoid the error of `ImportError: libtorch_cuda_cpp.so: ELF load command address/offset not properly aligned.`. + dontStrip = true; + pythonImportsCheck = [ "torch" ]; meta = with lib; { description = "Open source, prototype-to-production deep learning platform"; homepage = "https://pytorch.org/"; changelog = "https://github.com/pytorch/pytorch/releases/tag/v${version}"; - license = licenses.unfree; # Includes CUDA and Intel MKL. + # Includes CUDA and Intel MKL, but redistributions of the binary are not limited. + # https://docs.nvidia.com/cuda/eula/index.html + # https://www.intel.com/content/www/us/en/developer/articles/license/onemkl-license-faq.html + license = licenses.bsd3; platforms = platforms.linux; maintainers = with maintainers; [ junjihashimoto ]; }; diff --git a/pkgs/development/python-modules/pytorch/binary-hashes.nix b/pkgs/development/python-modules/pytorch/binary-hashes.nix index 0fbf9ae91287..dd3e5dc1ae3e 100644 --- a/pkgs/development/python-modules/pytorch/binary-hashes.nix +++ b/pkgs/development/python-modules/pytorch/binary-hashes.nix @@ -6,21 +6,21 @@ # To add a new version, run "prefetch.sh 'new-version'" to paste the generated file as follows. version : builtins.getAttr version { - "1.9.1" = { + "1.10.0" = { x86_64-linux-37 = { - name = "torch-1.9.1-cp37-cp37m-linux_x86_64.whl"; - url = "https://download.pytorch.org/whl/cu111/torch-1.9.1%2Bcu111-cp37-cp37m-linux_x86_64.whl"; - hash = "sha256-qzXbbpLX+ZlRv41oAyQRk3guU0n/6vuNzWw+nOieL6s="; + name = "torch-1.10.0-cp37-cp37m-linux_x86_64.whl"; + url = "https://download.pytorch.org/whl/cu113/torch-1.10.0%2Bcu113-cp37-cp37m-linux_x86_64.whl"; + hash = "sha256-KpDbklee2HXSqgrWr1U1nj8EJqUjBWp7SbACw8xtKtg="; }; x86_64-linux-38 = { - name = "torch-1.9.1-cp38-cp38-linux_x86_64.whl"; - url = "https://download.pytorch.org/whl/cu111/torch-1.9.1%2Bcu111-cp38-cp38-linux_x86_64.whl"; - hash = "sha256-JUbcqugax08/iN1LKfXq0ohSpejmbKhbT0by7qMGAzw="; + name = "torch-1.10.0-cp38-cp38-linux_x86_64.whl"; + url = "https://download.pytorch.org/whl/cu113/torch-1.10.0%2Bcu113-cp38-cp38-linux_x86_64.whl"; + hash = "sha256-zM3cMriUG9A+3in/ChzOLytRETpe4ju4uXkxasIRQYM="; }; x86_64-linux-39 = { - name = "torch-1.9.1-cp39-cp39-linux_x86_64.whl"; - url = "https://download.pytorch.org/whl/cu111/torch-1.9.1%2Bcu111-cp39-cp39-linux_x86_64.whl"; - hash = "sha256-wNLLtR9ZxKkVOTzwbAikM5H83pXyH+aPHVFyfrO4c1M="; + name = "torch-1.10.0-cp39-cp39-linux_x86_64.whl"; + url = "https://download.pytorch.org/whl/cu113/torch-1.10.0%2Bcu113-cp39-cp39-linux_x86_64.whl"; + hash = "sha256-w8UJDh4b5cgDu7ZSvDoKzNH4hiXEyRfvpycNOg+wJOg="; }; }; } diff --git a/pkgs/development/python-modules/pytorch/prefetch.sh b/pkgs/development/python-modules/pytorch/prefetch.sh index 65007f11bf7b..debf26bfa20a 100755 --- a/pkgs/development/python-modules/pytorch/prefetch.sh +++ b/pkgs/development/python-modules/pytorch/prefetch.sh @@ -1,18 +1,19 @@ #!/usr/bin/env nix-shell #!nix-shell -i bash -p nix-prefetch-scripts +set -eou pipefail + version=$1 -bucket="https://download.pytorch.org/whl/cu111" +bucket="https://download.pytorch.org/whl/cu113" url_and_key_list=( -"x86_64-linux-37 $bucket/torch-${version}%2Bcu111-cp37-cp37m-linux_x86_64.whl torch-${version}-cp37-cp37m-linux_x86_64.whl" -"x86_64-linux-38 $bucket/torch-${version}%2Bcu111-cp38-cp38-linux_x86_64.whl torch-${version}-cp38-cp38-linux_x86_64.whl" -"x86_64-linux-39 $bucket/torch-${version}%2Bcu111-cp39-cp39-linux_x86_64.whl torch-${version}-cp39-cp39-linux_x86_64.whl" + "x86_64-linux-37 $bucket/torch-${version}%2Bcu113-cp37-cp37m-linux_x86_64.whl torch-${version}-cp37-cp37m-linux_x86_64.whl" + "x86_64-linux-38 $bucket/torch-${version}%2Bcu113-cp38-cp38-linux_x86_64.whl torch-${version}-cp38-cp38-linux_x86_64.whl" + "x86_64-linux-39 $bucket/torch-${version}%2Bcu113-cp39-cp39-linux_x86_64.whl torch-${version}-cp39-cp39-linux_x86_64.whl" ) -hashfile=binary-hashes-"$version".nix -rm -f $hashfile +hashfile="binary-hashes-$version.nix" echo " \"$version\" = {" >> $hashfile for url_and_key in "${url_and_key_list[@]}"; do