Bump the binaries of torchvision

This commit is contained in:
Junji Hashimoto 2021-08-27 16:52:40 +09:00
parent f42c48129e
commit 71cda4fbef
4 changed files with 78 additions and 16 deletions

View file

@ -5408,6 +5408,12 @@
githubId = 39434424;
name = "Felix Springer";
};
junjihashimoto = {
email = "junji.hashimoto@gmail.com";
github = "junjihashimoto";
githubId = 2469618;
name = "Junji Hashimoto";
};
justinas = {
email = "justinas@justinas.org";
github = "justinas";

View file

@ -9,13 +9,13 @@
, pillow
, python
, pytorch-bin
, version ? "0.10.0"
}:
let
pyVerNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
srcs = import ./binary-hashes.nix version;
unsupported = throw "Unsupported system";
version = "0.9.1";
in buildPythonPackage {
inherit version;
@ -54,6 +54,6 @@ in buildPythonPackage {
changelog = "https://github.com/pytorch/vision/releases/tag/v${version}";
license = licenses.bsd3;
platforms = platforms.linux;
maintainers = with maintainers; [ danieldk ];
maintainers = with maintainers; [ danieldk junjihashimoto ];
};
}

View file

@ -3,20 +3,41 @@
# Precompiled wheels can be found at:
# https://download.pytorch.org/whl/torch_stable.html
version: {
x86_64-linux-37 = {
name = "torchvision-${version}-cp37-cp37m-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu111/torchvision-${version}%2Bcu111-cp37-cp37m-linux_x86_64.whl";
hash = "sha256-7EMVB8KZg2I3P4RqnIVk/7OOAPA1OWOipns58cSCUrw=";
# To add a new version, run "prefetch.sh 'new-version'" to paste the generated file as follows.
version : builtins.getAttr version {
"0.9.1" = {
x86_64-linux-37 = {
name = "torchvision-0.9.1-cp37-cp37m-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu111/torchvision-0.9.1%2Bcu111-cp37-cp37m-linux_x86_64.whl";
hash = "sha256-7EMVB8KZg2I3P4RqnIVk/7OOAPA1OWOipns58cSCUrw=";
};
x86_64-linux-38 = {
name = "torchvision-0.9.1-cp38-cp38-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu111/torchvision-0.9.1%2Bcu111-cp38-cp38-linux_x86_64.whl";
hash = "sha256-VjsCBW9Lusr4aDQLqaFh5dpV/5ZJ5PDs7nY4CbCHDTA=";
};
x86_64-linux-39 = {
name = "torchvision-0.9.1-cp39-cp39-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu111/torchvision-0.9.1%2Bcu111-cp39-cp39-linux_x86_64.whl";
hash = "sha256-pzR7TBE+WcAmozskoeOVBuMkGJf9tvsaXsUkTcu86N8=";
};
};
x86_64-linux-38 = {
name = "torchvision-${version}-cp38-cp38-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu111/torchvision-${version}%2Bcu111-cp38-cp38-linux_x86_64.whl";
hash = "sha256-VjsCBW9Lusr4aDQLqaFh5dpV/5ZJ5PDs7nY4CbCHDTA=";
};
x86_64-linux-39 = {
name = "torchvision-${version}-cp39-cp39-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu111/torchvision-${version}%2Bcu111-cp39-cp39-linux_x86_64.whl";
hash = "sha256-pzR7TBE+WcAmozskoeOVBuMkGJf9tvsaXsUkTcu86N8=";
"0.10.0" = {
x86_64-linux-37 = {
name = "torchvision-0.10.0-cp37-cp37m-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu111/torchvision-0.10.0%2Bcu111-cp37-cp37m-linux_x86_64.whl";
sha256 = "1kh6zrid4jv2qh1fpgnghsy2p0k5dc9pmk90484bdziskn313j68";
};
x86_64-linux-38 = {
name = "torchvision-0.10.0-cp38-cp38-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu111/torchvision-0.10.0%2Bcu111-cp38-cp38-linux_x86_64.whl";
sha256 = "1xxlkdjj85sryvah381byfa1xgsl21vc307gjnbknxdchbxz0mm7";
};
x86_64-linux-39 = {
name = "torchvision-0.10.0-cp39-cp39-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu111/torchvision-0.10.0%2Bcu111-cp39-cp39-linux_x86_64.whl";
sha256 = "18gcf9nj5cfvvm7qqhkiq4y5sgzrwfsdhqxcwrqx4mg1fjff3rq0";
};
};
}

View file

@ -0,0 +1,35 @@
#!/usr/bin/env bash
version=$1
bucket="https://download.pytorch.org/whl/cu111"
url_and_key_list=(
"x86_64-linux-37 $bucket/torchvision-${version}%2Bcu111-cp37-cp37m-linux_x86_64.whl torchvision-${version}-cp37-cp37m-linux_x86_64.whl"
"x86_64-linux-38 $bucket/torchvision-${version}%2Bcu111-cp38-cp38-linux_x86_64.whl torchvision-${version}-cp38-cp38-linux_x86_64.whl"
"x86_64-linux-39 $bucket/torchvision-${version}%2Bcu111-cp39-cp39-linux_x86_64.whl torchvision-${version}-cp39-cp39-linux_x86_64.whl"
)
hashfile=binary-hashes-"$version".nix
rm -f $hashfile
echo " \"$version\" = {" >> $hashfile
for url_and_key in "${url_and_key_list[@]}"; do
key=$(echo "$url_and_key" | cut -d' ' -f1)
url=$(echo "$url_and_key" | cut -d' ' -f2)
name=$(echo "$url_and_key" | cut -d' ' -f3)
echo "prefetching ${url}..."
hash=$(nix-prefetch-url "$url" --name "$name")
echo " $key = {" >> $hashfile
echo " name = \"$name\";" >> $hashfile
echo " url = \"$url\";" >> $hashfile
echo " sha256 = \"$hash\";" >> $hashfile
echo " };" >> $hashfile
echo
done
echo " };" >> $hashfile
echo "done."