Merge pull request #227420 from GaetanLepage/torchbin-update

python3Packages.torch-bin: 1.13.1 -> 2.0.0
This commit is contained in:
Sandro 2023-05-03 09:58:56 +02:00 committed by GitHub
commit 93640c56d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 446 additions and 179 deletions

View file

@ -75,7 +75,7 @@ in stdenv.mkDerivation rec {
# Should appear BEFORE lit, since lit passes through python rather
# than the python environment we make.
kleePython
(lit.override { python3 = kleePython; })
(lit.override { python = kleePython; })
];
cmakeFlags = let

View file

@ -1,16 +1,20 @@
{ lib, python3 }:
{ lib
, buildPythonPackage
, fetchPypi
, python
}:
python3.pkgs.buildPythonApplication rec {
buildPythonPackage rec {
pname = "lit";
version = "15.0.6";
src = python3.pkgs.fetchPypi {
src = fetchPypi {
inherit pname version;
hash = "sha256-S06OQfDmDyutls21HxyQ016ku3FTTsDOP8Di67d9f+k=";
};
passthru = {
python = python3;
inherit python;
};
# Non-standard test suite. Needs custom checkPhase.

View file

@ -0,0 +1,82 @@
{ lib
, stdenv
, addOpenGLRunpath
, cudaPackages
, buildPythonPackage
, fetchurl
, isPy38
, isPy39
, isPy310
, isPy311
, python
, autoPatchelfHook
, filelock
, lit
, pythonRelaxDepsHook
, zlib
}:
buildPythonPackage rec {
pname = "triton";
version = "2.0.0";
format = "wheel";
src =
let pyVerNoDot = lib.replaceStrings [ "." ] [ "" ] python.pythonVersion;
unsupported = throw "Unsupported system";
srcs = (import ./binary-hashes.nix version)."${stdenv.system}-${pyVerNoDot}" or unsupported;
in fetchurl srcs;
disabled = !(isPy38 || isPy39 || isPy310 || isPy311);
pythonRemoveDeps = [ "cmake" "torch" ];
buildInputs = [ zlib ];
nativeBuildInputs = [
pythonRelaxDepsHook # torch and triton refer to each other so this hook is included to mitigate that.
autoPatchelfHook
];
propagatedBuildInputs = [
filelock
lit
zlib
];
dontStrip = true;
# If this breaks, consider replacing with "${cuda_nvcc}/bin/ptxas"
postFixup = ''
chmod +x "$out/${python.sitePackages}/triton/third_party/cuda/bin/ptxas"
'' +
(let
# Bash was getting weird without linting,
# but basically upstream contains [cc, ..., "-lcuda", ...]
# and we replace it with [..., "-lcuda", "-L/run/opengl-driver/lib", "-L$stubs", ...]
old = [ "-lcuda" ];
new = [ "-lcuda" "-L${addOpenGLRunpath.driverLink}" "-L${cudaPackages.cuda_cudart}/lib/stubs/" ];
quote = x: ''"${x}"'';
oldStr = lib.concatMapStringsSep ", " quote old;
newStr = lib.concatMapStringsSep ", " quote new;
in
''
substituteInPlace $out/${python.sitePackages}/triton/compiler.py \
--replace '${oldStr}' '${newStr}'
'');
meta = with lib; {
description = "A language and compiler for custom Deep Learning operations";
homepage = "https://github.com/openai/triton/";
changelog = "https://github.com/openai/triton/releases/tag/v${version}";
# Includes NVIDIA's ptxas, but redistributions of the binary are not limited.
# https://docs.nvidia.com/cuda/eula/index.html
# triton's license is MIT.
# openai-triton-bin includes ptxas binary, therefore unfreeRedistributable is set.
license = with licenses; [ unfreeRedistributable mit ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ junjihashimoto ];
};
}

View file

@ -0,0 +1,31 @@
# Warning: Need to update at the same time as torch-bin
#
# Precompiled wheels can be found at:
# https://download.pytorch.org/whl/torch_stable.html
# To add a new version, run "prefetch.sh 'new-version'" to paste the generated file as follows.
version : builtins.getAttr version {
"2.0.0" = {
x86_64-linux-38 = {
name = "triton-2.0.0-1-cp38-cp38-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/triton-2.0.0-1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl";
hash = "sha256-nUl4KYt0/PWadf5x5TXAkrAjCIkzsvHfkz7DJhXkvu8=";
};
x86_64-linux-39 = {
name = "triton-2.0.0-1-cp39-cp39-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/triton-2.0.0-1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl";
hash = "sha256-dPEYwStDf7LKJeGgR1kXO1F1gvz0x74RkTMWx2QhNlY=";
};
x86_64-linux-310 = {
name = "triton-2.0.0-1-cp310-cp310-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/triton-2.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl";
hash = "sha256-OIBu6WY/Sw981keQ6WxXk3QInlj0mqxKZggSGqVeJQU=";
};
x86_64-linux-311 = {
name = "triton-2.0.0-1-cp311-cp311-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/triton-2.0.0-1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl";
hash = "sha256-ImlBx7hZUhnd71mh/bgh6MdEKJoTJBXd1YT6zt60dbE=";
};
};
}

View file

@ -0,0 +1,40 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix-prefetch-scripts
set -eou pipefail
version=$1
linux_bucket="https://download.pytorch.org/whl"
url_and_key_list=(
"x86_64-linux-38 $linux_bucket/triton-${version}-1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl triton-${version}-cp38-cp38-linux_x86_64.whl"
"x86_64-linux-39 $linux_bucket/triton-${version}-1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl triton-${version}-cp39-cp39-linux_x86_64.whl"
"x86_64-linux-310 $linux_bucket/triton-${version}-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl triton-${version}-cp310-cp310-linux_x86_64.whl"
"x86_64-linux-311 $linux_bucket/triton-${version}-1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl triton-${version}-cp311-cp311-linux_x86_64.whl"
)
hashfile=binary-hashes-"$version".nix
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 hash to-sri --type sha256 `nix-prefetch-url "$url" --name "$name"`)
cat << EOF >> $hashfile
$key = {
name = "$name";
url = "$url";
hash = "$hash";
};
EOF
echo
done
echo " };" >> $hashfile
echo "done."

View file

@ -1,26 +1,31 @@
{ lib, stdenv
, buildPythonPackage
, fetchurl
, isPy37
, isPy38
, isPy39
, isPy310
, python
, pythonAtLeast
, pythonOlder
, addOpenGLRunpath
, cudaPackages
, future
, numpy
, autoPatchelfHook
, patchelf
, pyyaml
, requests
, setuptools
, typing-extensions
, sympy
, jinja2
, networkx
, filelock
, openai-triton
}:
let
pyVerNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
srcs = import ./binary-hashes.nix version;
unsupported = throw "Unsupported system";
version = "1.13.1";
version = "2.0.0";
in buildPythonPackage {
inherit version;
@ -29,15 +34,31 @@ in buildPythonPackage {
format = "wheel";
disabled = !(isPy38 || isPy39 || isPy310);
disabled = (pythonOlder "3.8") || (pythonAtLeast "3.12");
src = fetchurl srcs."${stdenv.system}-${pyVerNoDot}" or unsupported;
nativeBuildInputs = [
addOpenGLRunpath
autoPatchelfHook
cudaPackages.autoAddOpenGLRunpathHook
patchelf
];
buildInputs = with cudaPackages; [
# $out/${sitePackages}/nvfuser/_C*.so wants libnvToolsExt.so.1 but torch/lib only ships
# libnvToolsExt-$hash.so.1
cuda_nvtx
];
autoPatchelfIgnoreMissingDeps = [
# This is the hardware-dependent userspace driver that comes from
# nvidia_x11 package. It must be deployed at runtime in
# /run/opengl-driver/lib or pointed at by LD_LIBRARY_PATH variable, rather
# than pinned in runpath
"libcuda.so.1"
];
propagatedBuildInputs = [
future
numpy
@ -45,6 +66,12 @@ in buildPythonPackage {
requests
setuptools
typing-extensions
sympy
jinja2
networkx
filelock
] ++ lib.optionals stdenv.isx86_64 [
openai-triton
];
postInstall = ''
@ -52,14 +79,20 @@ in buildPythonPackage {
rm -rf $out/bin
'';
postFixup = let
rpath = lib.makeLibraryPath [ stdenv.cc.cc.lib ];
in ''
find $out/${python.sitePackages}/torch/lib -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do
echo "setting rpath for $lib..."
patchelf --set-rpath "${rpath}:$out/${python.sitePackages}/torch/lib" "$lib"
addOpenGLRunpath "$lib"
done
postFixup = ''
addAutoPatchelfSearchPath "$out/${python.sitePackages}/torch/lib"
patchelf $out/${python.sitePackages}/torch/lib/libcudnn.so.8 --add-needed libcudnn_cnn_infer.so.8
pushd $out/${python.sitePackages}/torch/lib || exit 1
for LIBNVRTC in ./libnvrtc*
do
case "$LIBNVRTC" in
./libnvrtc-builtins*) true;;
./libnvrtc*) patchelf "$LIBNVRTC" --add-needed libnvrtc-builtins* ;;
esac
done
popd || exit 1
'';
# The wheel-binary is not stripped to avoid the error of `ImportError: libtorch_cuda_cpp.so: ELF load command address/offset not properly aligned.`.
@ -74,7 +107,9 @@ in buildPythonPackage {
# 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;
# torch's license is BSD3.
# torch-bin includes CUDA and MKL binaries, therefore unfreeRedistributable is set.
license = with licenses; [ bsd3 issl unfreeRedistributable ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ];
hydraPlatforms = []; # output size 3.2G on 1.11.0

View file

@ -6,66 +6,86 @@
# To add a new version, run "prefetch.sh 'new-version'" to paste the generated file as follows.
version : builtins.getAttr version {
"1.13.1" = {
"2.0.0" = {
x86_64-linux-38 = {
name = "torch-1.13.1-cp38-cp38-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp38-cp38-linux_x86_64.whl";
hash = "sha256-u/lUbw0Ni1EmPKR5Y3tCaogzX8oANPQs7GPU0y3uBa8=";
name = "torch-2.0.0-cp38-cp38-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torch-2.0.0%2Bcu118-cp38-cp38-linux_x86_64.whl";
hash = "sha256-H4766/y7fsOWL9jHw74CxmZu/1OhIEMAanSdZHZWFj4=";
};
x86_64-linux-39 = {
name = "torch-1.13.1-cp39-cp39-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp39-cp39-linux_x86_64.whl";
hash = "sha256-s6wTng1KCzA8wW9R63cUbsfRTAsecCrWOGE2KPUIavc=";
name = "torch-2.0.0-cp39-cp39-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torch-2.0.0%2Bcu118-cp39-cp39-linux_x86_64.whl";
hash = "sha256-6rl6n+WefjHWVisYb0NecXsd8zMcrcd25sBzIjmp7Tk=";
};
x86_64-linux-310 = {
name = "torch-1.13.1-cp310-cp310-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp310-cp310-linux_x86_64.whl";
hash = "sha256-FMXJ2wnfjPGzlCo0ecd52m4pOoShYtimrHHiveMOMMU=";
name = "torch-2.0.0-cp310-cp310-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torch-2.0.0%2Bcu118-cp310-cp310-linux_x86_64.whl";
hash = "sha256-S2kOK3fyEHNQDGXYu56pZWuMtOlp81c3C7yZKjsHR2Q=";
};
x86_64-linux-311 = {
name = "torch-2.0.0-cp311-cp311-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torch-2.0.0%2Bcu118-cp311-cp311-linux_x86_64.whl";
hash = "sha256-I4Vz02LFZBE0UQRvZwjDuBWP5rG39sA7cnMyfZVd61Q=";
};
x86_64-darwin-38 = {
name = "torch-1.13.1-cp38-none-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-1.13.1-cp38-none-macosx_10_9_x86_64.whl";
hash = "sha256-M+Z+6lJuC7uRUSY+ZUF6nvLY+lPL5ijocxAGDJ3PoxI=";
name = "torch-2.0.0-cp38-none-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-2.0.0-cp38-none-macosx_10_9_x86_64.whl";
hash = "sha256-zHiMu7vG60yQ5SxVDv0GdYbCaTCSzzZ8E1s0iTpkrng=";
};
x86_64-darwin-39 = {
name = "torch-1.13.1-cp39-none-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-1.13.1-cp39-none-macosx_10_9_x86_64.whl";
hash = "sha256-aTB5HvqHV8tpdK9z1Jlra1DFkogqMkuPsFicapui3a8=";
name = "torch-2.0.0-cp39-none-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-2.0.0-cp39-none-macosx_10_9_x86_64.whl";
hash = "sha256-bguXvrA3oWVmnDElkfJCOC6RCaJA4gBU1aV4LZI2ytA=";
};
x86_64-darwin-310 = {
name = "torch-1.13.1-cp310-none-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-1.13.1-cp310-none-macosx_10_9_x86_64.whl";
hash = "sha256-OTpic8gy4EdYEGP7dDNf9QtMVmIXAZzGrOMYzXnrBWY=";
name = "torch-2.0.0-cp310-none-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-2.0.0-cp310-none-macosx_10_9_x86_64.whl";
hash = "sha256-zptaSb1RPf95UKWgfW4mWU3VGYnO4FujiLA+jjZv1dU=";
};
x86_64-darwin-311 = {
name = "torch-2.0.0-cp311-none-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-2.0.0-cp311-none-macosx_10_9_x86_64.whl";
hash = "sha256-AYWGIPJfJeep7EtUf/OOXifJLTjsTMupz7+zHXBx7Zw=";
};
aarch64-darwin-38 = {
name = "torch-1.13.1-cp38-none-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-1.13.1-cp38-none-macosx_11_0_arm64.whl";
hash = "sha256-7usgTTD9QK9qLYCHm0an77489Dzb64g43U89EmzJCys=";
name = "torch-2.0.0-cp38-none-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-2.0.0-cp38-none-macosx_11_0_arm64.whl";
hash = "sha256-0pJkDw/XK3oxsqbjtjXrUGX8vt1EePnK0aHnqeyGHTU=";
};
aarch64-darwin-39 = {
name = "torch-1.13.1-cp39-none-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-1.13.1-cp39-none-macosx_11_0_arm64.whl";
hash = "sha256-4N+QKnx91seVaYUy7llwzomGcmJWNdiF6t6ZduWgSUk=";
name = "torch-2.0.0-cp39-none-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-2.0.0-cp39-none-macosx_11_0_arm64.whl";
hash = "sha256-KXpJGa/xwPmKWOvpaSAPcTUKHU1PmG2/1gwC/854Dpk=";
};
aarch64-darwin-310 = {
name = "torch-1.13.1-cp310-none-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-1.13.1-cp310-none-macosx_11_0_arm64.whl";
hash = "sha256-ASKAaxEblJ0h+hpfl2TR/S/MSkfLf4/5FCBP1Px1LtU=";
name = "torch-2.0.0-cp310-none-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-2.0.0-cp310-none-macosx_11_0_arm64.whl";
hash = "sha256-U+HDPGiWWDzbmlg2k+IumSZkRMSkM5Ld3FYmQNOeVCs=";
};
aarch64-darwin-311 = {
name = "torch-2.0.0-cp311-none-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torch-2.0.0-cp311-none-macosx_11_0_arm64.whl";
hash = "sha256-mi5TtXg+9YlqavM4s214LyjoPI3fwqxEtnsGbZ129Jg=";
};
aarch64-linux-38 = {
name = "torch-1.13.1-cp38-cp38-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torch-1.13.1-cp38-cp38-manylinux2014_aarch64.whl";
hash = "sha256-34Q0sGlenOuMxwZQr8ExDYupSebbKgUl3dnDsrGB5f4=";
name = "torch-2.0.0-cp38-cp38-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torch-2.0.0-cp38-cp38-manylinux2014_aarch64.whl";
hash = "sha256-EbA4T+PBjAG4/FmS5w/FGc3mXkTFHMh74YOMGAPa9C8=";
};
aarch64-linux-39 = {
name = "torch-1.13.1-cp39-cp39-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torch-1.13.1-cp39-cp39-manylinux2014_aarch64.whl";
hash = "sha256-LDWBo/2B6x8PIpl83f/qVp/qU7r6NyssBHHbNzsmqvw=";
name = "torch-2.0.0-cp39-cp39-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torch-2.0.0-cp39-cp39-manylinux2014_aarch64.whl";
hash = "sha256-qDsmvWrjb79f7j1Wlz2YFuIALoo7fZIFUxFnwoqqOKc=";
};
aarch64-linux-310 = {
name = "torch-1.13.1-cp310-cp310-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torch-1.13.1-cp310-cp310-manylinux2014_aarch64.whl";
hash = "sha256-2f54XTdfLial1eul3pH4nmo75dEe+0l+dnBf35P6PC4=";
name = "torch-2.0.0-cp310-cp310-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torch-2.0.0-cp310-cp310-manylinux2014_aarch64.whl";
hash = "sha256-nwH+H2Jj8xvQThdXlG/WOtUxrjfyi7Lb9m9cgm7gifQ=";
};
aarch64-linux-311 = {
name = "torch-2.0.0-cp311-cp311-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torch-2.0.0-cp311-cp311-manylinux2014_aarch64.whl";
hash = "sha256-1Dmuw0nJjxKBnoVkuMVACORhPdRChYKvDm4UwkyoWHA=";
};
};
}

View file

@ -5,7 +5,7 @@ set -eou pipefail
version=$1
linux_cuda_version="cu117"
linux_cuda_version="cu118"
linux_cuda_bucket="https://download.pytorch.org/whl/${linux_cuda_version}"
linux_cpu_bucket="https://download.pytorch.org/whl"
darwin_bucket="https://download.pytorch.org/whl/cpu"
@ -14,15 +14,19 @@ url_and_key_list=(
"x86_64-linux-38 $linux_cuda_bucket/torch-${version}%2B${linux_cuda_version}-cp38-cp38-linux_x86_64.whl torch-${version}-cp38-cp38-linux_x86_64.whl"
"x86_64-linux-39 $linux_cuda_bucket/torch-${version}%2B${linux_cuda_version}-cp39-cp39-linux_x86_64.whl torch-${version}-cp39-cp39-linux_x86_64.whl"
"x86_64-linux-310 $linux_cuda_bucket/torch-${version}%2B${linux_cuda_version}-cp310-cp310-linux_x86_64.whl torch-${version}-cp310-cp310-linux_x86_64.whl"
"x86_64-linux-311 $linux_cuda_bucket/torch-${version}%2B${linux_cuda_version}-cp311-cp311-linux_x86_64.whl torch-${version}-cp311-cp311-linux_x86_64.whl"
"x86_64-darwin-38 $darwin_bucket/torch-${version}-cp38-none-macosx_10_9_x86_64.whl torch-${version}-cp38-none-macosx_10_9_x86_64.whl"
"x86_64-darwin-39 $darwin_bucket/torch-${version}-cp39-none-macosx_10_9_x86_64.whl torch-${version}-cp39-none-macosx_10_9_x86_64.whl"
"x86_64-darwin-310 $darwin_bucket/torch-${version}-cp310-none-macosx_10_9_x86_64.whl torch-${version}-cp310-none-macosx_10_9_x86_64.whl"
"x86_64-darwin-311 $darwin_bucket/torch-${version}-cp311-none-macosx_10_9_x86_64.whl torch-${version}-cp311-none-macosx_10_9_x86_64.whl"
"aarch64-darwin-38 $darwin_bucket/torch-${version}-cp38-none-macosx_11_0_arm64.whl torch-${version}-cp38-none-macosx_11_0_arm64.whl"
"aarch64-darwin-39 $darwin_bucket/torch-${version}-cp39-none-macosx_11_0_arm64.whl torch-${version}-cp39-none-macosx_11_0_arm64.whl"
"aarch64-darwin-310 $darwin_bucket/torch-${version}-cp310-none-macosx_11_0_arm64.whl torch-${version}-cp310-none-macosx_11_0_arm64.whl"
"aarch64-darwin-311 $darwin_bucket/torch-${version}-cp311-none-macosx_11_0_arm64.whl torch-${version}-cp311-none-macosx_11_0_arm64.whl"
"aarch64-linux-38 $linux_cpu_bucket/torch-${version}-cp38-cp38-manylinux2014_aarch64.whl torch-${version}-cp38-cp38-manylinux2014_aarch64.whl"
"aarch64-linux-39 $linux_cpu_bucket/torch-${version}-cp39-cp39-manylinux2014_aarch64.whl torch-${version}-cp39-cp39-manylinux2014_aarch64.whl"
"aarch64-linux-310 $linux_cpu_bucket/torch-${version}-cp310-cp310-manylinux2014_aarch64.whl torch-${version}-cp310-cp310-manylinux2014_aarch64.whl"
"aarch64-linux-311 $linux_cpu_bucket/torch-${version}-cp311-cp311-manylinux2014_aarch64.whl torch-${version}-cp311-cp311-manylinux2014_aarch64.whl"
)
hashfile="binary-hashes-$version.nix"

View file

@ -1,47 +1,61 @@
{ lib
, stdenv
, addOpenGLRunpath
, autoPatchelfHook
, buildPythonPackage
, cudaPackages
, fetchurl
, isPy37
, isPy38
, isPy39
, isPy310
, ffmpeg_4
, pythonAtLeast
, pythonOlder
, python
, torch-bin
, pythonOlder
, pythonAtLeast
}:
buildPythonPackage rec {
pname = "torchaudio";
version = "0.13.1";
version = "2.0.1";
format = "wheel";
src =
let pyVerNoDot = lib.replaceStrings [ "." ] [ "" ] python.pythonVersion;
unsupported = throw "Unsupported system";
srcs = (import ./binary-hashes.nix version)."${stdenv.system}-${pyVerNoDot}" or unsupported;
in fetchurl srcs;
in
fetchurl srcs;
disabled = !(isPy38 || isPy39 || isPy310);
disabled = (pythonOlder "3.8") || (pythonAtLeast "3.12");
buildInputs = with cudaPackages; [
# $out/${sitePackages}/torchaudio/lib/libtorchaudio*.so wants libcudart.so.11.0 but torch/lib only ships
# libcudart.$hash.so.11.0
cuda_cudart
# $out/${sitePackages}/torchaudio/lib/libtorchaudio*.so wants libnvToolsExt.so.2 but torch/lib only ships
# libnvToolsExt-$hash.so.1
cuda_nvtx
ffmpeg_4.lib
];
nativeBuildInputs = [
autoPatchelfHook
addOpenGLRunpath
];
propagatedBuildInputs = [
torch-bin
];
preInstall = ''
addAutoPatchelfSearchPath "${torch-bin}/${python.sitePackages}/torch"
'';
# 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 = [ "torchaudio" ];
postFixup = ''
# Note: after patchelf'ing, libcudart can still not be found. However, this should
# not be an issue, because PyTorch is loaded before torchvision and brings
# in the necessary symbols.
patchelf --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:${torch-bin}/${python.sitePackages}/torch/lib:" \
"$out/${python.sitePackages}/torchaudio/_torchaudio.so"
'';
meta = with lib; {
description = "PyTorch audio library";
homepage = "https://pytorch.org/";

View file

@ -6,66 +6,86 @@
# To add a new version, run "prefetch.sh 'new-version'" to paste the generated file as follows.
version : builtins.getAttr version {
"0.13.1" = {
"2.0.1" = {
x86_64-linux-38 = {
name = "torchaudio-0.13.1-cp38-cp38-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu117/torchaudio-0.13.1%2Bcu117-cp38-cp38-linux_x86_64.whl";
hash = "sha256-QCY7LUVyj7/x2zOBJyvkKXD/blj5KZSqWHKlvUx+cmQ=";
name = "torchaudio-2.0.1-cp38-cp38-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torchaudio-2.0.1%2Bcu118-cp38-cp38-linux_x86_64.whl";
hash = "sha256-lLDpx2ypHR4CiYlZIPv+jBF0ZNdXtktd+tsTCM+ZBPk=";
};
x86_64-linux-39 = {
name = "torchaudio-0.13.1-cp39-cp39-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu117/torchaudio-0.13.1%2Bcu117-cp39-cp39-linux_x86_64.whl";
hash = "sha256-Zbs2FdQz1bkwrNwQNu+xJAR9VxfbpN63D0GSkNlC+DY=";
name = "torchaudio-2.0.1-cp39-cp39-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torchaudio-2.0.1%2Bcu118-cp39-cp39-linux_x86_64.whl";
hash = "sha256-Bws4SWlhQr49keCycHbaHz+MtDKrzONc2VbRkfwNgYc=";
};
x86_64-linux-310 = {
name = "torchaudio-0.13.1-cp310-cp310-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu117/torchaudio-0.13.1%2Bcu117-cp310-cp310-linux_x86_64.whl";
hash = "sha256-k/RVSktT+WmNAiJJA8kjwSpsIrPJQtz8IXm1gdjzcUY=";
name = "torchaudio-2.0.1-cp310-cp310-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torchaudio-2.0.1%2Bcu118-cp310-cp310-linux_x86_64.whl";
hash = "sha256-GcTvkBIyTE+4DqZpNFUbeAfZcUjChTji6rr+FqtQ6Rw=";
};
x86_64-linux-311 = {
name = "torchaudio-2.0.1-cp311-cp311-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torchaudio-2.0.1%2Bcu118-cp311-cp311-linux_x86_64.whl";
hash = "sha256-GicitvZleO3FY+d7TMB6ItZjorte5cneJTlmGpihTbk=";
};
x86_64-darwin-38 = {
name = "torchaudio-0.13.1-cp38-cp38-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/torchaudio-0.13.1-cp38-cp38-macosx_10_9_x86_64.whl";
hash = "sha256-Qs5cZtMEvCzWgziRa4Ij4yLgmoTcvZIogU7za8R3o3s=";
name = "torchaudio-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl";
hash = "sha256-AiyhuqS7gZt4NDvUe1f/bcb5/Bn6TvJplGqt9+Yts8A=";
};
x86_64-darwin-39 = {
name = "torchaudio-0.13.1-cp39-cp39-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/torchaudio-0.13.1-cp39-cp39-macosx_10_9_x86_64.whl";
hash = "sha256-nSFwVA3jKuAxqrOTYSmGjoluoEFhe21mkt3mqi37CiM=";
name = "torchaudio-2.0.1-cp39-cp39-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-2.0.1-cp39-cp39-macosx_10_9_x86_64.whl";
hash = "sha256-48bI+eqfDi33oLk3Ww3PlVkG44/BL6tUK3KoYVZK+Oc=";
};
x86_64-darwin-310 = {
name = "torchaudio-0.13.1-cp310-cp310-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/torchaudio-0.13.1-cp310-cp310-macosx_10_9_x86_64.whl";
hash = "sha256-Xg89xmmVBlITZCZnBOa/idDQV5/UNdEsXC9YWNUt5Po=";
name = "torchaudio-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl";
hash = "sha256-tdIeu7VecEDUGNUGKw6IL5Zg1otHezj9Q2+mySzLtSo=";
};
x86_64-darwin-311 = {
name = "torchaudio-2.0.1-cp311-cp311-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-2.0.1-cp311-cp311-macosx_10_9_x86_64.whl";
hash = "sha256-4qBHZ1STwKolj+xiHvQOiwGr49jbyHIVLktZmEGKo8U=";
};
aarch64-darwin-38 = {
name = "torchaudio-0.13.1-cp38-cp38-macosx_12_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-0.13.1-cp38-cp38-macosx_12_0_arm64.whl";
hash = "sha256-sJOz52YchRaOyd3iz5c0WWXqCTHT0qfni9QJIh5taZg=";
name = "torchaudio-2.0.1-cp38-cp38-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-2.0.1-cp38-cp38-macosx_11_0_arm64.whl";
hash = "sha256-oVOtXNti3o7J/RNgoNCAu6851XiuBOeI2yEVceZ1t+A=";
};
aarch64-darwin-39 = {
name = "torchaudio-0.13.1-cp39-cp39-macosx_12_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-0.13.1-cp39-cp39-macosx_12_0_arm64.whl";
hash = "sha256-kfz79HAAQC0Sv/JiTmIgoP07jKjub/Ue31lF7DmrCn8=";
name = "torchaudio-2.0.1-cp39-cp39-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-2.0.1-cp39-cp39-macosx_11_0_arm64.whl";
hash = "sha256-HQzwd5ozTsGGHp+ii862amM8Quj2szIuLjf/nyDQroE=";
};
aarch64-darwin-310 = {
name = "torchaudio-0.13.1-cp310-cp310-macosx_12_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-0.13.1-cp310-cp310-macosx_12_0_arm64.whl";
hash = "sha256-7HKhfU0heIKed4BoKZm1Nc9X/hYNDCCw1r3BrRqHxN0=";
name = "torchaudio-2.0.1-cp310-cp310-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-2.0.1-cp310-cp310-macosx_11_0_arm64.whl";
hash = "sha256-bbzZOynXGi9QDzajTqXkZ/UQ93PahTIgmOa92MncmUg=";
};
aarch64-darwin-311 = {
name = "torchaudio-2.0.1-cp311-cp311-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchaudio-2.0.1-cp311-cp311-macosx_11_0_arm64.whl";
hash = "sha256-kaKOWH9wigMyDt28xKfdGtcVCz1IRrbBVX2FzImo0Gw=";
};
aarch64-linux-38 = {
name = "torchaudio-0.13.1-cp38-cp38-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torchaudio-0.13.1-cp38-cp38-manylinux2014_aarch64.whl";
hash = "sha256-PEi8/wDq6BgPh/WNHJ5+n9jEy36z6ogXk1+2BI0VK8c=";
name = "torchaudio-2.0.1-cp38-cp38-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torchaudio-2.0.1-cp38-cp38-manylinux2014_aarch64.whl";
hash = "sha256-qlsjzsMVcWRKpn1s1QGzl/QmVX3F8y6NtuzbJ7GUClg=";
};
aarch64-linux-39 = {
name = "torchaudio-0.13.1-cp39-cp39-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torchaudio-0.13.1-cp39-cp39-manylinux2014_aarch64.whl";
hash = "sha256-MCOutcGRBHvvFoGjdBv/1KIWS1imTK0k3TfaXhrC0fE=";
name = "torchaudio-2.0.1-cp39-cp39-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torchaudio-2.0.1-cp39-cp39-manylinux2014_aarch64.whl";
hash = "sha256-ry16SysebkDnnA7d0Qezu0MVkdBJTX+X7ffBhkN7XBo=";
};
aarch64-linux-310 = {
name = "torchaudio-0.13.1-cp310-cp310-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torchaudio-0.13.1-cp310-cp310-manylinux2014_aarch64.whl";
hash = "sha256-LkdWLNzdR8uO2Go88FO3BnzJ6INA9FUK5z15DdvBLyE=";
name = "torchaudio-2.0.1-cp310-cp310-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torchaudio-2.0.1-cp310-cp310-manylinux2014_aarch64.whl";
hash = "sha256-6f/6Y0Gbxl7Pg5Vo3QS+O6VibF9bJsmlZsA4KtKXcck=";
};
aarch64-linux-311 = {
name = "torchaudio-2.0.1-cp311-cp311-manylinux2014_aarch64.whl";
url = "https://download.pytorch.org/whl/torchaudio-2.0.1-cp311-cp311-manylinux2014_aarch64.whl";
hash = "sha256-MkQuKxHfwJxMW2zEuSTT84wslGPuKOSGUi+fSLCbf7c=";
};
};
}

View file

@ -5,24 +5,28 @@ set -eou pipefail
version=$1
linux_cuda_version="cu117"
linux_cuda_version="cu118"
linux_cuda_bucket="https://download.pytorch.org/whl/${linux_cuda_version}"
linux_cpu_bucket="https://download.pytorch.org/whl"
darwin_bucket="https://download.pytorch.org/whl"
darwin_bucket="https://download.pytorch.org/whl/cpu"
url_and_key_list=(
"x86_64-linux-38 $linux_cuda_bucket/torchaudio-${version}%2B${linux_cuda_version}-cp38-cp38-linux_x86_64.whl torchaudio-${version}-cp38-cp38-linux_x86_64.whl"
"x86_64-linux-39 $linux_cuda_bucket/torchaudio-${version}%2B${linux_cuda_version}-cp39-cp39-linux_x86_64.whl torchaudio-${version}-cp39-cp39-linux_x86_64.whl"
"x86_64-linux-310 $linux_cuda_bucket/torchaudio-${version}%2B${linux_cuda_version}-cp310-cp310-linux_x86_64.whl torchaudio-${version}-cp310-cp310-linux_x86_64.whl"
"x86_64-linux-311 $linux_cuda_bucket/torchaudio-${version}%2B${linux_cuda_version}-cp311-cp311-linux_x86_64.whl torchaudio-${version}-cp311-cp311-linux_x86_64.whl"
"x86_64-darwin-38 $darwin_bucket/torchaudio-${version}-cp38-cp38-macosx_10_9_x86_64.whl torchaudio-${version}-cp38-cp38-macosx_10_9_x86_64.whl"
"x86_64-darwin-39 $darwin_bucket/torchaudio-${version}-cp39-cp39-macosx_10_9_x86_64.whl torchaudio-${version}-cp39-cp39-macosx_10_9_x86_64.whl"
"x86_64-darwin-310 $darwin_bucket/torchaudio-${version}-cp310-cp310-macosx_10_9_x86_64.whl torchaudio-${version}-cp310-cp310-macosx_10_9_x86_64.whl"
"aarch64-darwin-38 $darwin_bucket/cpu/torchaudio-${version}-cp38-cp38-macosx_12_0_arm64.whl torchaudio-${version}-cp38-cp38-macosx_12_0_arm64.whl"
"aarch64-darwin-39 $darwin_bucket/cpu/torchaudio-${version}-cp39-cp39-macosx_12_0_arm64.whl torchaudio-${version}-cp39-cp39-macosx_12_0_arm64.whl"
"aarch64-darwin-310 $darwin_bucket/cpu/torchaudio-${version}-cp310-cp310-macosx_12_0_arm64.whl torchaudio-${version}-cp310-cp310-macosx_12_0_arm64.whl"
"x86_64-darwin-311 $darwin_bucket/torchaudio-${version}-cp311-cp311-macosx_10_9_x86_64.whl torchaudio-${version}-cp311-cp311-macosx_10_9_x86_64.whl"
"aarch64-darwin-38 $darwin_bucket/torchaudio-${version}-cp38-cp38-macosx_11_0_arm64.whl torchaudio-${version}-cp38-cp38-macosx_11_0_arm64.whl"
"aarch64-darwin-39 $darwin_bucket/torchaudio-${version}-cp39-cp39-macosx_11_0_arm64.whl torchaudio-${version}-cp39-cp39-macosx_11_0_arm64.whl"
"aarch64-darwin-310 $darwin_bucket/torchaudio-${version}-cp310-cp310-macosx_11_0_arm64.whl torchaudio-${version}-cp310-cp310-macosx_11_0_arm64.whl"
"aarch64-darwin-311 $darwin_bucket/torchaudio-${version}-cp311-cp311-macosx_11_0_arm64.whl torchaudio-${version}-cp311-cp311-macosx_11_0_arm64.whl"
"aarch64-linux-38 $linux_cpu_bucket/torchaudio-${version}-cp38-cp38-manylinux2014_aarch64.whl torchaudio-${version}-cp38-cp38-manylinux2014_aarch64.whl"
"aarch64-linux-39 $linux_cpu_bucket/torchaudio-${version}-cp39-cp39-manylinux2014_aarch64.whl torchaudio-${version}-cp39-cp39-manylinux2014_aarch64.whl"
"aarch64-linux-310 $linux_cpu_bucket/torchaudio-${version}-cp310-cp310-manylinux2014_aarch64.whl torchaudio-${version}-cp310-cp310-manylinux2014_aarch64.whl"
"aarch64-linux-311 $linux_cpu_bucket/torchaudio-${version}-cp311-cp311-manylinux2014_aarch64.whl torchaudio-${version}-cp311-cp311-manylinux2014_aarch64.whl"
)
hashfile=binary-hashes-"$version".nix

View file

@ -1,12 +1,12 @@
{ lib
, stdenv
, addOpenGLRunpath
, autoPatchelfHook
, buildPythonPackage
, cudaPackages
, fetchurl
, isPy37
, isPy38
, isPy39
, isPy310
, patchelf
, pythonAtLeast
, pythonOlder
, pillow
, python
, torch-bin
@ -16,7 +16,7 @@ let
pyVerNoDot = builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion;
srcs = import ./binary-hashes.nix version;
unsupported = throw "Unsupported system";
version = "0.14.1";
version = "0.15.1";
in buildPythonPackage {
inherit version;
@ -26,10 +26,17 @@ in buildPythonPackage {
src = fetchurl srcs."${stdenv.system}-${pyVerNoDot}" or unsupported;
disabled = !(isPy37 || isPy38 || isPy39 || isPy310);
disabled = (pythonOlder "3.8") || (pythonAtLeast "3.12");
buildInputs = with cudaPackages; [
# $out/${sitePackages}/torchvision/_C.so wants libcudart.so.11.0 but torchvision.libs only ships
# libcudart.$hash.so.11.0
cuda_cudart
];
nativeBuildInputs = [
patchelf
autoPatchelfHook
addOpenGLRunpath
];
propagatedBuildInputs = [
@ -42,14 +49,8 @@ in buildPythonPackage {
pythonImportsCheck = [ "torchvision" ];
postFixup = let
rpath = lib.makeLibraryPath [ stdenv.cc.cc.lib ];
in ''
# Note: after patchelf'ing, libcudart can still not be found. However, this should
# not be an issue, because PyTorch is loaded before torchvision and brings
# in the necessary symbols.
patchelf --set-rpath "${rpath}:${torch-bin}/${python.sitePackages}/torch/lib:" \
"$out/${python.sitePackages}/torchvision/_C.so"
preInstall = ''
addAutoPatchelfSearchPath "${torch-bin}/${python.sitePackages}/torch"
'';
meta = with lib; {

View file

@ -6,61 +6,66 @@
# To add a new version, run "prefetch.sh 'new-version'" to paste the generated file as follows.
version : builtins.getAttr version {
"0.14.1" = {
x86_64-linux-37 = {
name = "torchvision-0.14.1-cp37-cp37m-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp37-cp37m-linux_x86_64.whl";
hash = "sha256-vOOhWqGuclcvjNKOSdHsGtjwhm+7ZhxzaNnBKF9psi4=";
};
"0.15.1" = {
x86_64-linux-38 = {
name = "torchvision-0.14.1-cp38-cp38-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp38-cp38-linux_x86_64.whl";
hash = "sha256-dAk4UTnOiGTOssgv/OM46+FaVRk/S4DEKm0PnP14Fik=";
name = "torchvision-0.15.1-cp38-cp38-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torchvision-0.15.1%2Bcu118-cp38-cp38-linux_x86_64.whl";
hash = "sha256-kQRzDWVavygsKEXUzUcrsIk288hQg6KK79dq2e6v8mE=";
};
x86_64-linux-39 = {
name = "torchvision-0.14.1-cp39-cp39-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp39-cp39-linux_x86_64.whl";
hash = "sha256-iomg7gB9fNulO9VkJth5UGCgZLiRm2GsOeAOOZ3ta+I=";
name = "torchvision-0.15.1-cp39-cp39-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torchvision-0.15.1%2Bcu118-cp39-cp39-linux_x86_64.whl";
hash = "sha256-Xs4nnI9SH49jc7+XHyrcY6lh1pTErO1TjfgSlCEO5Lo=";
};
x86_64-linux-310 = {
name = "torchvision-0.14.1-cp310-cp310-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp310-cp310-linux_x86_64.whl";
hash = "sha256-g9JxpTA5KBS4x/aTgihcrHx9p5uPXcxrz1bGKFR7zlM=";
name = "torchvision-0.15.1-cp310-cp310-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torchvision-0.15.1%2Bcu118-cp310-cp310-linux_x86_64.whl";
hash = "sha256-mmefo3p0EBjIBCNGk7usPUh/s91V7nP2szZ3sXfIwHo=";
};
x86_64-darwin-37 = {
name = "torchvision-0.14.1-cp37-cp37m-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/torchvision-0.14.1-cp37-cp37m-macosx_10_9_x86_64.whl";
hash = "sha256-+3p5P9M84avsJLQneEGaP7HjFZ19/LJ0o8qPuMvECNw=";
x86_64-linux-311 = {
name = "torchvision-0.15.1-cp311-cp311-linux_x86_64.whl";
url = "https://download.pytorch.org/whl/cu118/torchvision-0.15.1%2Bcu118-cp311-cp311-linux_x86_64.whl";
hash = "sha256-nO0skO54K7tBWw3mW8wQ1P6BETGGRnm3B0QsnZ6Kqv0=";
};
x86_64-darwin-38 = {
name = "torchvision-0.14.1-cp38-cp38-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/torchvision-0.14.1-cp38-cp38-macosx_10_9_x86_64.whl";
hash = "sha256-aO0DNZ3NPanNIbirlNohFY34pqDFutC/SkLw5EjSjLM=";
name = "torchvision-0.15.1-cp38-cp38-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.15.1-cp38-cp38-macosx_10_9_x86_64.whl";
hash = "sha256-5YYbqu6ofRm2/X0THhGkpr0XvhQjTEkKJZuzYHdelSA=";
};
x86_64-darwin-39 = {
name = "torchvision-0.14.1-cp39-cp39-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/torchvision-0.14.1-cp39-cp39-macosx_10_9_x86_64.whl";
hash = "sha256-xedE9W5fW0Ut61/A8/K6TS8AYS0U2NoNvv6o8JrHaQs=";
name = "torchvision-0.15.1-cp39-cp39-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.15.1-cp39-cp39-macosx_10_9_x86_64.whl";
hash = "sha256-Hf3sfH35ZzMLujNBp4HgwEfU4BY+ZxZKmRhQA2K/fZE=";
};
x86_64-darwin-310 = {
name = "torchvision-0.14.1-cp310-cp310-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/torchvision-0.14.1-cp310-cp310-macosx_10_9_x86_64.whl";
hash = "sha256-7rBd2d069UKP7lJUAHWdr42o5MrsRd3WkIz7NlcfZDM=";
name = "torchvision-0.15.1-cp310-cp310-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.15.1-cp310-cp310-macosx_10_9_x86_64.whl";
hash = "sha256-vBDUjppg0AbQwbSN6ofx7Jtj2FZzfVkvfFxEzYfz9Lc=";
};
x86_64-darwin-311 = {
name = "torchvision-0.15.1-cp311-cp311-macosx_10_9_x86_64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.15.1-cp311-cp311-macosx_10_9_x86_64.whl";
hash = "sha256-l7kOs7czOjHQScTM/RBkNh6EkYdJWdOPRmr2TWdBjO8=";
};
aarch64-darwin-38 = {
name = "torchvision-0.14.1-cp38-cp38-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.14.1-cp38-cp38-macosx_11_0_arm64.whl";
hash = "sha256-MPzw6f5X1KxM5kJmWaV9zhmWN8y2xwvhEoZw8XdpJiQ=";
name = "torchvision-0.15.1-cp38-cp38-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.15.1-cp38-cp38-macosx_11_0_arm64.whl";
hash = "sha256-5xTzYrnYIXz01oUJtnnryd3xKM/oD2wd744/ihhGbnU=";
};
aarch64-darwin-39 = {
name = "torchvision-0.14.1-cp39-cp39-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.14.1-cp39-cp39-macosx_11_0_arm64.whl";
hash = "sha256-dYsg0HnoELR0C9YNHrFuSdqDDjNg+b43nrF37iIfpdQ=";
name = "torchvision-0.15.1-cp39-cp39-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.15.1-cp39-cp39-macosx_11_0_arm64.whl";
hash = "sha256-wVNxAYbOwDONT/9BFFmlfdvIUEQ2EjynOz8L3Cb/kYw=";
};
aarch64-darwin-310 = {
name = "torchvision-0.14.1-cp310-cp310-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.14.1-cp310-cp310-macosx_11_0_arm64.whl";
hash = "sha256-jQdm6pKv+nrySOMn3YX3yc/fUaV1MLQyEtThhYVI6dc=";
name = "torchvision-0.15.1-cp310-cp310-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.15.1-cp310-cp310-macosx_11_0_arm64.whl";
hash = "sha256-NwjTQQ/cr2KA41jNqd4qSrBswLTA/ZrurFUOwlY6iH4=";
};
aarch64-darwin-311 = {
name = "torchvision-0.15.1-cp311-cp311-macosx_11_0_arm64.whl";
url = "https://download.pytorch.org/whl/cpu/torchvision-0.15.1-cp311-cp311-macosx_11_0_arm64.whl";
hash = "sha256-a2DhyDmuKgcb77ummxdGjWf+r99XbpD/lkW/vumY3hc=";
};
};
}

View file

@ -5,22 +5,23 @@ set -eou pipefail
version=$1
linux_cuda_version="cu117"
linux_cuda_version="cu118"
linux_bucket="https://download.pytorch.org/whl/${linux_cuda_version}"
darwin_bucket="https://download.pytorch.org/whl"
darwin_bucket="https://download.pytorch.org/whl/cpu"
url_and_key_list=(
"x86_64-linux-37 $linux_bucket/torchvision-${version}%2B${linux_cuda_version}-cp37-cp37m-linux_x86_64.whl torchvision-${version}-cp37-cp37m-linux_x86_64.whl"
"x86_64-linux-38 $linux_bucket/torchvision-${version}%2B${linux_cuda_version}-cp38-cp38-linux_x86_64.whl torchvision-${version}-cp38-cp38-linux_x86_64.whl"
"x86_64-linux-39 $linux_bucket/torchvision-${version}%2B${linux_cuda_version}-cp39-cp39-linux_x86_64.whl torchvision-${version}-cp39-cp39-linux_x86_64.whl"
"x86_64-linux-310 $linux_bucket/torchvision-${version}%2B${linux_cuda_version}-cp310-cp310-linux_x86_64.whl torchvision-${version}-cp310-cp310-linux_x86_64.whl"
"x86_64-darwin-37 $darwin_bucket/torchvision-${version}-cp37-cp37m-macosx_10_9_x86_64.whl torchvision-${version}-cp37-cp37m-macosx_10_9_x86_64.whl"
"x86_64-linux-311 $linux_bucket/torchvision-${version}%2B${linux_cuda_version}-cp311-cp311-linux_x86_64.whl torchvision-${version}-cp311-cp311-linux_x86_64.whl"
"x86_64-darwin-38 $darwin_bucket/torchvision-${version}-cp38-cp38-macosx_10_9_x86_64.whl torchvision-${version}-cp38-cp38-macosx_10_9_x86_64.whl"
"x86_64-darwin-39 $darwin_bucket/torchvision-${version}-cp39-cp39-macosx_10_9_x86_64.whl torchvision-${version}-cp39-cp39-macosx_10_9_x86_64.whl"
"x86_64-darwin-310 $darwin_bucket/torchvision-${version}-cp310-cp310-macosx_10_9_x86_64.whl torchvision-${version}-cp310-cp310-macosx_10_9_x86_64.whl"
"aarch64-darwin-38 $darwin_bucket/cpu/torchvision-${version}-cp38-cp38-macosx_11_0_arm64.whl torchvision-${version}-cp38-cp38-macosx_11_0_arm64.whl"
"aarch64-darwin-39 $darwin_bucket/cpu/torchvision-${version}-cp39-cp39-macosx_11_0_arm64.whl torchvision-${version}-cp39-cp39-macosx_11_0_arm64.whl"
"aarch64-darwin-310 $darwin_bucket/cpu/torchvision-${version}-cp310-cp310-macosx_11_0_arm64.whl torchvision-${version}-cp310-cp310-macosx_11_0_arm64.whl"
"x86_64-darwin-311 $darwin_bucket/torchvision-${version}-cp311-cp311-macosx_10_9_x86_64.whl torchvision-${version}-cp311-cp311-macosx_10_9_x86_64.whl"
"aarch64-darwin-38 $darwin_bucket/torchvision-${version}-cp38-cp38-macosx_11_0_arm64.whl torchvision-${version}-cp38-cp38-macosx_11_0_arm64.whl"
"aarch64-darwin-39 $darwin_bucket/torchvision-${version}-cp39-cp39-macosx_11_0_arm64.whl torchvision-${version}-cp39-cp39-macosx_11_0_arm64.whl"
"aarch64-darwin-310 $darwin_bucket/torchvision-${version}-cp310-cp310-macosx_11_0_arm64.whl torchvision-${version}-cp310-cp310-macosx_11_0_arm64.whl"
"aarch64-darwin-311 $darwin_bucket/torchvision-${version}-cp311-cp311-macosx_11_0_arm64.whl torchvision-${version}-cp311-cp311-macosx_11_0_arm64.whl"
)
hashfile="binary-hashes-$version.nix"

View file

@ -18526,7 +18526,7 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Security;
};
lit = callPackage ../development/tools/misc/lit { };
lit = with python3Packages; toPythonApplication lit;
litecli = callPackage ../development/tools/database/litecli { };

View file

@ -5716,6 +5716,8 @@ self: super: with self; {
python3 = python;
});
lit = callPackage ../development/python-modules/lit { };
littleutils = callPackage ../development/python-modules/littleutils { };
livelossplot = callPackage ../development/python-modules/livelossplot { };
@ -6896,6 +6898,8 @@ self: super: with self; {
openai-triton = callPackage ../development/python-modules/openai-triton { llvmPackages = pkgs.llvmPackages_rocm; };
openai-triton-bin = callPackage ../development/python-modules/openai-triton/bin.nix { };
openai-whisper = callPackage ../development/python-modules/openai-whisper {
cudaSupport = pkgs.config.cudaSupport or false;
};
@ -11988,7 +11992,9 @@ self: super: with self; {
inherit (pkgs.llvmPackages_rocm) openmp;
};
torch-bin = callPackage ../development/python-modules/torch/bin.nix { };
torch-bin = callPackage ../development/python-modules/torch/bin.nix {
openai-triton = self.openai-triton-bin;
};
torchWithCuda = self.torch.override {
magma = pkgs.magma-cuda;