python3Packages.torch: 2.7.1 -> 2.8.0

Diff: https://github.com/pytorch/pytorch/compare/v2.7.1...v2.8.0

Changelog: https://github.com/pytorch/pytorch/releases/tag/v2.8.0

Co-authored-by: Luna Nova <git@lunnova.dev>

Changed files
+156 -106
pkgs
development
python-modules
+46 -23
pkgs/development/python-modules/torch/source/default.nix
···
lib,
fetchFromGitHub,
fetchFromGitLab,
git-unroll,
buildPythonPackage,
python,
···
# Build inputs
apple-sdk_13,
numactl,
llvmPackages,
···
setBool = v: if v then "1" else "0";
-
# https://github.com/pytorch/pytorch/blob/v2.7.0/torch/utils/cpp_extension.py#L2343-L2345
supportedTorchCudaCapabilities =
let
real = [
···
"10.0a"
"10.1"
"10.1a"
"12.0"
"12.0a"
];
ptx = lists.map (x: "${x}+PTX") real;
in
···
rocm-comgr
rocm-device-libs
rocm-runtime
clr.icd
hipify
];
···
buildPythonPackage rec {
pname = "torch";
# Don't forget to update torch-bin to the same version.
-
version = "2.7.1";
pyproject = true;
stdenv = stdenv';
···
patches = [
./clang19-template-warning.patch
]
-
++ lib.optionals cudaSupport [ ./fix-cmake-cuda-toolkit.patch ]
++ lib.optionals stdenv.hostPlatform.isLinux [
# Propagate CUPTI to Kineto by overriding the search path with environment variables.
# https://github.com/pytorch/pytorch/pull/108847
···
];
postPatch = ''
-
# Prevent NCCL from being cloned during the configure phase
-
# TODO: remove when updating to the next release as it will not be needed anymore
-
substituteInPlace tools/build_pytorch_libs.py \
-
--replace-fail " checkout_nccl()" " "
-
substituteInPlace cmake/public/cuda.cmake \
--replace-fail \
'message(FATAL_ERROR "Found two conflicting CUDA' \
···
"# Upstream: set(CUDAToolkit_ROOT"
substituteInPlace third_party/gloo/cmake/Cuda.cmake \
--replace-warn "find_package(CUDAToolkit 7.0" "find_package(CUDAToolkit"
-
-
# annotations (3.7), print_function (3.0), with_statement (2.6) are all supported
sed -i -e "/from __future__ import/d" **.py
substituteInPlace third_party/NNPACK/CMakeLists.txt \
--replace-fail "PYTHONPATH=" 'PYTHONPATH=$ENV{PYTHONPATH}:'
-
# flag from cmakeFlags doesn't work, not clear why
-
# setting it at the top of NNPACK's own CMakeLists does
sed -i '2s;^;set(PYTHON_SIX_SOURCE_DIR ${six.src})\n;' third_party/NNPACK/CMakeLists.txt
-
-
# Ensure that torch profiler unwind uses addr2line from nix
substituteInPlace torch/csrc/profiler/unwind/unwind.cpp \
--replace-fail 'addr2line_binary_ = "addr2line"' 'addr2line_binary_ = "${lib.getExe' binutils "addr2line"}"'
''
···
# https://github.com/facebookincubator/gloo/pull/297
substituteInPlace third_party/gloo/cmake/Hipify.cmake \
--replace-fail "\''${HIPIFY_COMMAND}" "python \''${HIPIFY_COMMAND}"
-
-
# Replace hard-coded rocm paths
-
substituteInPlace caffe2/CMakeLists.txt \
-
--replace-fail "hcc/include" "hip/include" \
-
--replace-fail "rocblas/include" "include/rocblas" \
-
--replace-fail "hipsparse/include" "include/hipsparse"
# Doesn't pick up the environment variable?
substituteInPlace third_party/kineto/libkineto/CMakeLists.txt \
--replace-fail "\''$ENV{ROCM_SOURCE_DIR}" "${rocmtoolkit_joined}"
-
# Strangely, this is never set in cmake
substituteInPlace cmake/public/LoadHIP.cmake \
-
--replace "set(ROCM_PATH \$ENV{ROCM_PATH})" \
-
"set(ROCM_PATH \$ENV{ROCM_PATH})''\nset(ROCM_VERSION ${lib.concatStrings (lib.intersperse "0" (lib.splitVersion rocmPackages.clr.version))})"
# Use composable kernel as dependency, rather than built-in third-party
substituteInPlace aten/src/ATen/CMakeLists.txt \
···
lib,
fetchFromGitHub,
fetchFromGitLab,
+
fetchpatch2,
git-unroll,
buildPythonPackage,
python,
···
# Build inputs
apple-sdk_13,
+
openssl,
numactl,
llvmPackages,
···
setBool = v: if v then "1" else "0";
+
# https://github.com/pytorch/pytorch/blob/v2.8.0/torch/utils/cpp_extension.py#L2411-L2414
supportedTorchCudaCapabilities =
let
real = [
···
"10.0a"
"10.1"
"10.1a"
+
"10.3"
+
"10.3a"
"12.0"
"12.0a"
+
"12.1"
+
"12.1a"
];
ptx = lists.map (x: "${x}+PTX") real;
in
···
rocm-comgr
rocm-device-libs
rocm-runtime
+
rocm-smi
clr.icd
hipify
];
···
buildPythonPackage rec {
pname = "torch";
# Don't forget to update torch-bin to the same version.
+
version = "2.8.0";
pyproject = true;
stdenv = stdenv';
···
patches = [
./clang19-template-warning.patch
+
+
# Do not override PYTHONPATH, otherwise, the build fails with:
+
# ModuleNotFoundError: No module named 'typing_extensions'
+
(fetchpatch2 {
+
name = "cmake-build-preserve-PYTHONPATH";
+
url = "https://github.com/pytorch/pytorch/commit/231c72240d80091f099c95e326d3600cba866eee.patch";
+
hash = "sha256-7f9qtr7ljqjKdj3DqpcCTS0/Hr2AwOzOl/HA88yU3zI=";
+
})
]
+
++ lib.optionals cudaSupport [
+
./fix-cmake-cuda-toolkit.patch
+
./nvtx3-hpp-path-fix.patch
+
]
++ lib.optionals stdenv.hostPlatform.isLinux [
# Propagate CUPTI to Kineto by overriding the search path with environment variables.
# https://github.com/pytorch/pytorch/pull/108847
···
];
postPatch = ''
+
substituteInPlace pyproject.toml \
+
--replace-fail "setuptools>=62.3.0,<80.0" "setuptools"
+
''
+
# Provide path to openssl binary for inductor code cache hash
+
# InductorError: FileNotFoundError: [Errno 2] No such file or directory: 'openssl'
+
+ ''
+
substituteInPlace torch/_inductor/codecache.py \
+
--replace-fail '"openssl"' '"${lib.getExe openssl}"'
+
''
+
+ ''
substituteInPlace cmake/public/cuda.cmake \
--replace-fail \
'message(FATAL_ERROR "Found two conflicting CUDA' \
···
"# Upstream: set(CUDAToolkit_ROOT"
substituteInPlace third_party/gloo/cmake/Cuda.cmake \
--replace-warn "find_package(CUDAToolkit 7.0" "find_package(CUDAToolkit"
+
''
+
# annotations (3.7), print_function (3.0), with_statement (2.6) are all supported
+
+ ''
sed -i -e "/from __future__ import/d" **.py
substituteInPlace third_party/NNPACK/CMakeLists.txt \
--replace-fail "PYTHONPATH=" 'PYTHONPATH=$ENV{PYTHONPATH}:'
+
''
+
# flag from cmakeFlags doesn't work, not clear why
+
# setting it at the top of NNPACK's own CMakeLists does
+
+ ''
sed -i '2s;^;set(PYTHON_SIX_SOURCE_DIR ${six.src})\n;' third_party/NNPACK/CMakeLists.txt
+
''
+
# Ensure that torch profiler unwind uses addr2line from nix
+
+ ''
substituteInPlace torch/csrc/profiler/unwind/unwind.cpp \
--replace-fail 'addr2line_binary_ = "addr2line"' 'addr2line_binary_ = "${lib.getExe' binutils "addr2line"}"'
''
···
# https://github.com/facebookincubator/gloo/pull/297
substituteInPlace third_party/gloo/cmake/Hipify.cmake \
--replace-fail "\''${HIPIFY_COMMAND}" "python \''${HIPIFY_COMMAND}"
# Doesn't pick up the environment variable?
substituteInPlace third_party/kineto/libkineto/CMakeLists.txt \
--replace-fail "\''$ENV{ROCM_SOURCE_DIR}" "${rocmtoolkit_joined}"
+
# Workaround cmake error //include does not exist! in rocm-core-config.cmake
+
# Removing the call falls back to hip_version. Can likely be removed after ROCm 6.4 bump
substituteInPlace cmake/public/LoadHIP.cmake \
+
--replace-fail \
+
"find_package(rocm-core CONFIG)" \
+
""
# Use composable kernel as dependency, rather than built-in third-party
substituteInPlace aten/src/ATen/CMakeLists.txt \
+26
pkgs/development/python-modules/torch/source/nvtx3-hpp-path-fix.patch
···
···
+
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+
index a93386c27f8..7c6b98006bf 100644
+
--- a/cmake/Dependencies.cmake
+
+++ b/cmake/Dependencies.cmake
+
@@ -967,7 +967,7 @@ endif()
+
+
# ---[ nvtx
+
if(USE_SYSTEM_NVTX)
+
- find_path(nvtx3_dir NAMES nvtx3 PATHS ${CUDA_INCLUDE_DIRS})
+
+ find_path(nvtx3_dir NAMES nvtx3/nvtx3.hpp PATHS ${CUDA_INCLUDE_DIRS})
+
find_package_handle_standard_args(nvtx3 DEFAULT_MSG nvtx3_dir)
+
if(NOT nvtx3_FOUND)
+
message(WARNING "Cannot find system NVTX3, find shipped NVTX3 instead")
+
@@ -977,9 +977,10 @@ if(NOT TARGET CUDA::nvtx3)
+
add_library(CUDA::nvtx3 INTERFACE IMPORTED)
+
endif()
+
if(NOT nvtx3_dir)
+
- find_path(nvtx3_dir NAMES nvtx3 PATHS "${PROJECT_SOURCE_DIR}/third_party/NVTX/c/include" NO_DEFAULT_PATH)
+
- target_include_directories(CUDA::nvtx3 INTERFACE "${nvtx3_dir}")
+
+ find_path(nvtx3_dir NAMES nvtx3/nvtx3.hpp PATHS "${PROJECT_SOURCE_DIR}/third_party/NVTX/c/include" NO_DEFAULT_PATH)
+
endif()
+
+target_include_directories(CUDA::nvtx3 INTERFACE "${nvtx3_dir}")
+
+message(STATUS "Using NVTX3 include directory: ${nvtx3_dir}")
+
+
+
# ---[ HIP
+84 -83
pkgs/development/python-modules/torch/source/src.nix
···
fetchFromGitHub,
runCommand,
}:
-
assert version == "2.7.1";
(rec {
src_asmjit = fetchFromGitHub {
owner = "asmjit";
repo = "asmjit";
-
rev = "d3fbf7c9bc7c1d1365a94a45614b91c5a3706b81";
-
hash = "sha256-0Wv9dxrh9GfajTFb+NpguqqSWH0mqJAj03bxFVJbft8=";
};
src_benchmark = fetchFromGitHub {
owner = "google";
repo = "benchmark";
-
rev = "0d98dba29d66e93259db7daa53a9327df767a415";
-
hash = "sha256-yUiFxi80FWBmTZgqmqTMf9oqcBeg3o4I4vKd4djyRWY=";
};
src_benchmark_opentelemetry-cpp = fetchFromGitHub {
owner = "google";
···
rev = "8086bbe3a78d931eb96fe12fdc014082e18d18d3";
hash = "sha256-fyL1SzRs5CXW5CWy6kCN1y1xX6cG+ur7iQlbKX2zbCM=";
};
src_composable_kernel_flash-attention = fetchFromGitHub {
owner = "ROCm";
repo = "composable_kernel";
···
src_cpp-httplib = fetchFromGitHub {
owner = "yhirose";
repo = "cpp-httplib";
-
rev = "3b6597bba913d51161383657829b7e644e59c006";
-
hash = "sha256-dd9NckF1mGhQOyV1LO07QyP51l1kSpYQOH0GkG4v2eE=";
};
src_cpr = fetchFromGitHub {
owner = "libcpr";
···
src_cpuinfo = fetchFromGitHub {
owner = "pytorch";
repo = "cpuinfo";
-
rev = "1e83a2fdd3102f65c6f1fb602c1b320486218a99";
-
hash = "sha256-28cFACca+NYE8oKlP5aWXNCLeEjhWqJ6gRnFI+VxDvg=";
};
src_cpuinfo_fbgemm = fetchFromGitHub {
owner = "pytorch";
repo = "cpuinfo";
-
rev = "ed8b86a253800bafdb7b25c5c399f91bff9cb1f3";
-
hash = "sha256-YRqBU83AjxbSE5zquhi4iIiJna/qFWA0jo2GBifqzi8=";
};
src_cudnn-frontend = fetchFromGitHub {
owner = "NVIDIA";
repo = "cudnn-frontend";
-
rev = "91b7532f3386768bba4f444ee7672b497f34da8a";
-
hash = "sha256-Ks07ApADA3xQQ+N5BIfvDG+djCvxYL9btF8Aw7TuMvQ=";
};
src_cutlass = fetchFromGitHub {
owner = "NVIDIA";
repo = "cutlass";
-
rev = "afa1772203677c5118fcd82537a9c8fefbcc7008";
-
hash = "sha256-oIzlbKRdOh6gp6nRZ8udLSqleBFoFtgM7liCBlHZLOk=";
};
src_cutlass_fbgemm = fetchFromGitHub {
-
owner = "NVIDIA";
repo = "cutlass";
-
rev = "fc9ebc645b63f3a6bc80aaefde5c063fb72110d6";
-
hash = "sha256-e2SwXNNwjl/1fV64b+mOJvwGDYeO1LFcqZGbNten37U=";
};
src_cutlass_flash-attention = fetchFromGitHub {
owner = "NVIDIA";
···
rev = "7d04a0053a845370ae06ce317a22a48e9edcc74e";
hash = "sha256-Je6wAz+uJ/AiAnSZVQ4+pGajZ8DymS0qI9ekB8fGYOo=";
};
-
src_eigen = fetchFromGitLab {
-
domain = "gitlab.com";
-
owner = "libeigen";
-
repo = "eigen";
-
rev = "3147391d946bb4b6c68edd901f2add6ac1f31f8c";
-
hash = "sha256-1/4xMetKMDOgZgzz3WMxfHUEpmdAm52RqZvz6i0mLEw=";
-
};
src_fbgemm = fetchFromGitHub {
owner = "pytorch";
repo = "fbgemm";
-
rev = "dbc3157bf256f1339b3fa1fef2be89ac4078be0e";
-
hash = "sha256-PJiFtLnPA6IgxZ2sXIcyyjFRGtb+sG5y2hiWEwFuBOU=";
};
src_fbjni = fetchFromGitHub {
owner = "facebookincubator";
···
src_flatbuffers = fetchFromGitHub {
owner = "google";
repo = "flatbuffers";
-
rev = "01834de25e4bf3975a9a00e816292b1ad0fe184b";
-
hash = "sha256-h0lF7jf1cDVVyqhUCi7D0NoZ3b4X/vWXsFplND80lGs=";
};
src_fmt = fetchFromGitHub {
owner = "fmtlib";
repo = "fmt";
-
rev = "123913715afeb8a437e6388b4473fcc4753e1c9a";
-
hash = "sha256-sUbxlYi/Aupaox3JjWFqXIjcaQa0LFjclQAOleT+FRA=";
};
src_fmt_dynolog = fetchFromGitHub {
owner = "fmtlib";
···
hash = "sha256-xqRp9vaauBkKz2CXbh/Z4TWqhaUtqfbsSlbYZR/kW9s=";
};
src_gloo = fetchFromGitHub {
-
owner = "facebookincubator";
repo = "gloo";
-
rev = "5354032ea08eadd7fc4456477f7f7c6308818509";
-
hash = "sha256-JMLtxyQz7jechJ5DmMq0guOfL9leI6khdI9g/5Ckgfc=";
};
src_googletest = fetchFromGitHub {
owner = "google";
repo = "googletest";
-
rev = "b514bdc898e2951020cbdca1304b75f5950d1f59";
-
hash = "sha256-1OJ2SeSscRBNr7zZ/a8bJGIqAnhkg45re0j3DtPfcXM=";
};
src_googletest_dynolog = fetchFromGitHub {
owner = "google";
···
src_googletest_fbgemm = fetchFromGitHub {
owner = "google";
repo = "googletest";
-
rev = "cbf019de22c8dd37b2108da35b2748fd702d1796";
-
hash = "sha256-G6NihPly7czG2NOX66kFfcf5ya+XRrUWt4SP1Y9JPzs=";
};
src_googletest_kineto = fetchFromGitHub {
owner = "google";
···
src_hipify_torch = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "hipify_torch";
-
rev = "23f53b025b466d8ec3c45d52290d3442f7fbe6b1";
-
hash = "sha256-ohbGKy0sxa5pQy9EwsZk2UWmjveCZaJu/PEK2MLbjII=";
};
src_ideep = fetchFromGitHub {
owner = "intel";
···
src_ittapi = fetchFromGitHub {
owner = "intel";
repo = "ittapi";
-
rev = "5b8a7d7422611c3a0d799fb5fc5dd4abfae35b42";
-
hash = "sha256-VxJky2TF3RcIMqjNaAK/mvpC0afkwpAsY0cD6Ergkls=";
};
src_json = fetchFromGitHub {
owner = "nlohmann";
repo = "json";
-
rev = "87cda1d6646592ac5866dc703c8e1839046a6806";
-
hash = "sha256-lXYJGWwLyQPqvxnDRWoDLXdjiD81r1eNHi7vRdbIuJ0=";
};
src_json_dynolog = fetchFromGitHub {
owner = "nlohmann";
···
rev = "4f8fba14066156b73f1189a2b8bd568bde5284c5";
hash = "sha256-DTsZrdB9GcaNkx7ZKxcgCA3A9ShM5icSF0xyGguJNbk=";
};
src_json_opentelemetry-cpp = fetchFromGitHub {
owner = "nlohmann";
repo = "json";
···
src_kineto = fetchFromGitHub {
owner = "pytorch";
repo = "kineto";
-
rev = "a054a4be0db117c579a21747debf19c863631f26";
-
hash = "sha256-FyxMiDoDrjI8JZZNxK4S18yjULkKLUvqLQsCyxaTLSg=";
};
src_kleidiai = fetchFromGitHub {
owner = "ARM-software";
repo = "kleidiai";
-
rev = "ef685a13cfbe8d418aa2ed34350e21e4938358b6";
-
hash = "sha256-5RS2o+163/6Q+0y0FuWz6OBXw3FKxZINDkGOqlmd2N0=";
};
src_libnop = fetchFromGitHub {
owner = "google";
···
src_mimalloc = fetchFromGitHub {
owner = "microsoft";
repo = "mimalloc";
-
rev = "b66e3214d8a104669c2ec05ae91ebc26a8f5ab78";
-
hash = "sha256-uwuqln08Hx1d2l7GNn8/8hzOA1Pmzob5g17XgFb+blg=";
};
src_mkl-dnn = fetchFromGitHub {
owner = "intel";
···
src_NVTX = fetchFromGitHub {
owner = "NVIDIA";
repo = "NVTX";
-
rev = "e170594ac7cf1dac584da473d4ca9301087090c1";
-
hash = "sha256-n34BPxRnAW301ba1lXqSlGh7jaPqNjpp45GnJ+yDapI=";
};
src_onnx = fetchFromGitHub {
owner = "onnx";
repo = "onnx";
-
rev = "b8baa8446686496da4cc8fda09f2b6fe65c2a02c";
-
hash = "sha256-9oORW0YlQ6SphqfbjcYb0dTlHc+1gzy9quH/Lj6By8Q=";
};
src_opentelemetry-cpp = fetchFromGitHub {
owner = "open-telemetry";
···
src_pocketfft = fetchFromGitHub {
owner = "mreineck";
repo = "pocketfft";
-
rev = "9d3ab05a7fffbc71a492bc6a17be034e83e8f0fe";
-
hash = "sha256-RSbimayr8Np7YP0aUo1MNusFmhi9jjDfgGXbiISR+/8=";
};
src_prometheus-cpp = fetchFromGitHub {
owner = "jupp0r";
···
rev = "a2e59f0e7065404b44dfe92a28aca47ba1378dc4";
hash = "sha256-SNLdtrOjaC3lGHN9MAqTf51U9EzNKQLyTMNPe0GcdrU=";
};
-
src_pybind11_onnx = fetchFromGitHub {
-
owner = "pybind";
-
repo = "pybind11";
-
rev = "3e9dfa2866941655c56877882565e7577de6fc7b";
-
hash = "sha256-DVkI5NxM5uME9m3PFYVpJOOa2j+yjL6AJn76fCTv2nE=";
-
};
src_pybind11_tensorpipe = fetchFromGitHub {
owner = "pybind";
repo = "pybind11";
···
src_pytorch = fetchFromGitHub {
owner = "pytorch";
repo = "pytorch";
-
rev = "v2.7.1";
-
hash = "sha256-p/SkVM6N4XGr44WB9ZaMLu6nfJGcaKHfb1hDY6qbZBw=";
};
src_sleef = fetchFromGitHub {
owner = "shibatch";
repo = "sleef";
-
rev = "56e1f79cb140fb9326d612d0be06b5250565cade";
-
hash = "sha256-5hha7c/Lu6fkbXGlDieoJP6n2bnjY5iPp+hm0f//0ek=";
};
src_tensorpipe = fetchFromGitHub {
owner = "pytorch";
···
src_VulkanMemoryAllocator = fetchFromGitHub {
owner = "GPUOpen-LibrariesAndSDKs";
repo = "VulkanMemoryAllocator";
-
rev = "a6bfc237255a6bac1513f7c1ebde6d8aed6b5191";
-
hash = "sha256-urUebQaPTgCECmm4Espri1HqYGy0ueAqTBu/VSiX/8I=";
};
src_XNNPACK = fetchFromGitHub {
owner = "google";
···
src_civetweb_recursive = src_civetweb;
src_clang-cindex-python3_recursive = src_clang-cindex-python3;
src_composable_kernel_recursive = src_composable_kernel;
src_composable_kernel_flash-attention_recursive = src_composable_kernel_flash-attention;
src_cpp-httplib_recursive = src_cpp-httplib;
src_cpr_recursive = src_cpr;
···
chmod u+w $out/third_party/pfs
cp -r ${src_pfs_recursive}/* $out/third_party/pfs
'';
-
src_eigen_recursive = src_eigen;
src_fbgemm_recursive = runCommand "fbgemm" { } ''
cp -r ${src_fbgemm} $out
-
chmod u+w $out/third_party/asmjit
-
cp -r ${src_asmjit_recursive}/* $out/third_party/asmjit
-
chmod u+w $out/third_party/cpuinfo
-
cp -r ${src_cpuinfo_fbgemm_recursive}/* $out/third_party/cpuinfo
-
chmod u+w $out/third_party/cutlass
-
cp -r ${src_cutlass_fbgemm_recursive}/* $out/third_party/cutlass
-
chmod u+w $out/third_party/googletest
-
cp -r ${src_googletest_fbgemm_recursive}/* $out/third_party/googletest
-
chmod u+w $out/third_party/hipify_torch
-
cp -r ${src_hipify_torch_recursive}/* $out/third_party/hipify_torch
'';
src_fbjni_recursive = src_fbjni;
src_flash-attention_recursive = runCommand "flash-attention" { } ''
···
src_ittapi_recursive = src_ittapi;
src_json_recursive = src_json;
src_json_dynolog_recursive = src_json_dynolog;
src_json_opentelemetry-cpp_recursive = src_json_opentelemetry-cpp;
src_kineto_recursive = runCommand "kineto" { } ''
cp -r ${src_kineto} $out
···
src_onnx_recursive = runCommand "onnx" { } ''
cp -r ${src_onnx} $out
chmod u+w $out/third_party/pybind11
-
cp -r ${src_pybind11_onnx_recursive}/* $out/third_party/pybind11
'';
src_opentelemetry-cpp_recursive = runCommand "opentelemetry-cpp" { } ''
cp -r ${src_opentelemetry-cpp} $out
···
src_psimd_recursive = src_psimd;
src_pthreadpool_recursive = src_pthreadpool;
src_pybind11_recursive = src_pybind11;
-
src_pybind11_onnx_recursive = src_pybind11_onnx;
src_pybind11_tensorpipe_recursive = runCommand "pybind11_tensorpipe" { } ''
cp -r ${src_pybind11_tensorpipe} $out
chmod u+w $out/tools/clang
···
cp -r ${src_cudnn-frontend_recursive}/* $out/third_party/cudnn_frontend
chmod u+w $out/third_party/cutlass
cp -r ${src_cutlass_recursive}/* $out/third_party/cutlass
-
chmod u+w $out/third_party/eigen
-
cp -r ${src_eigen_recursive}/* $out/third_party/eigen
chmod u+w $out/third_party/fbgemm
cp -r ${src_fbgemm_recursive}/* $out/third_party/fbgemm
chmod u+w $out/third_party/flash-attention
···
fetchFromGitHub,
runCommand,
}:
+
assert version == "2.8.0";
(rec {
src_asmjit = fetchFromGitHub {
owner = "asmjit";
repo = "asmjit";
+
rev = "e5d7c0bd5d9aec44d68830187138149e6a8c4e32";
+
hash = "sha256-sI0/9szBMvopQAmVcZSU4D/oaZYdb08AHDSZKy/Qz1g=";
};
src_benchmark = fetchFromGitHub {
owner = "google";
repo = "benchmark";
+
rev = "299e5928955cc62af9968370293b916f5130916f";
+
hash = "sha256-iPK3qLrZL2L08XW1a7SGl7GAt5InQ5nY+Dn8hBuxSOg=";
};
src_benchmark_opentelemetry-cpp = fetchFromGitHub {
owner = "google";
···
rev = "8086bbe3a78d931eb96fe12fdc014082e18d18d3";
hash = "sha256-fyL1SzRs5CXW5CWy6kCN1y1xX6cG+ur7iQlbKX2zbCM=";
};
+
src_composable_kernel_fbgemm = fetchFromGitHub {
+
owner = "jwfromm";
+
repo = "composable_kernel";
+
rev = "4a61bdd4bd4ed730e078aebc7c0fcf046ff29406";
+
hash = "sha256-CxcpvW4QxkUDB2zMz7NB6Rt9jXjJeGVExfrYbn9ef5I=";
+
};
src_composable_kernel_flash-attention = fetchFromGitHub {
owner = "ROCm";
repo = "composable_kernel";
···
src_cpp-httplib = fetchFromGitHub {
owner = "yhirose";
repo = "cpp-httplib";
+
rev = "3af7f2c16147f3fbc6e4d717032daf505dc1652c";
+
hash = "sha256-t/ddZjKelnXQdXQvZgv9pQcJt3M2rwgbtTQNW/T6Gpk=";
};
src_cpr = fetchFromGitHub {
owner = "libcpr";
···
src_cpuinfo = fetchFromGitHub {
owner = "pytorch";
repo = "cpuinfo";
+
rev = "5e3d2445e6a84d9599bee2bf78edbb4d80865e1d";
+
hash = "sha256-muclbtayPbbxmjTBKJlvTk2Apsx8YwhTu76nKMlSnL0=";
};
src_cpuinfo_fbgemm = fetchFromGitHub {
owner = "pytorch";
repo = "cpuinfo";
+
rev = "6543fec09b2f04ac4a666882998b534afc9c1349";
+
hash = "sha256-M33853TIMNTJwBjxIG8qeTPwXlX8b8uKiCrdnlAtAA8=";
};
src_cudnn-frontend = fetchFromGitHub {
owner = "NVIDIA";
repo = "cudnn-frontend";
+
rev = "666996fe3960f27170d1527e5579ba24c8d3380a";
+
hash = "sha256-/ae5dNjqkn5dGciGSO+Pn9pzJg+hHWqqQCPcqggWezo=";
};
src_cutlass = fetchFromGitHub {
owner = "NVIDIA";
repo = "cutlass";
+
rev = "ad7b2f5e84fcfa124cb02b91d5bd26d238c0459e";
+
hash = "sha256-teziPNA9csYvhkG5t2ht8W8x5+1YGGbHm8VKx4JoxgI=";
};
src_cutlass_fbgemm = fetchFromGitHub {
+
owner = "jwfromm";
repo = "cutlass";
+
rev = "3ed8d2ec4ba35ef5d9d8353826209b6f868f63d3";
+
hash = "sha256-NntohGvqs6fbWusi2Qv5uzCJhMAfBv8qYoFi38D+mzk=";
};
src_cutlass_flash-attention = fetchFromGitHub {
owner = "NVIDIA";
···
rev = "7d04a0053a845370ae06ce317a22a48e9edcc74e";
hash = "sha256-Je6wAz+uJ/AiAnSZVQ4+pGajZ8DymS0qI9ekB8fGYOo=";
};
src_fbgemm = fetchFromGitHub {
owner = "pytorch";
repo = "fbgemm";
+
rev = "157e88b750c452bef2ab4653fe9d1eeb151ce4c3";
+
hash = "sha256-Ka8/4gBsbtKNhKM/cWg1NmlKjVeBZvS+yS9SQQxb34A=";
};
src_fbjni = fetchFromGitHub {
owner = "facebookincubator";
···
src_flatbuffers = fetchFromGitHub {
owner = "google";
repo = "flatbuffers";
+
rev = "a2cd1ea3b6d3fee220106b5fed3f7ce8da9eb757";
+
hash = "sha256-6L6Eb+2xGXEqLYITWsNNPW4FTvfPFSmChK4hLusk5gU=";
};
src_fmt = fetchFromGitHub {
owner = "fmtlib";
repo = "fmt";
+
rev = "40626af88bd7df9a5fb80be7b25ac85b122d6c21";
+
hash = "sha256-sAlU5L/olxQUYcv8euVYWTTB8TrVeQgXLHtXy8IMEnU=";
};
src_fmt_dynolog = fetchFromGitHub {
owner = "fmtlib";
···
hash = "sha256-xqRp9vaauBkKz2CXbh/Z4TWqhaUtqfbsSlbYZR/kW9s=";
};
src_gloo = fetchFromGitHub {
+
owner = "pytorch";
repo = "gloo";
+
rev = "c7b7b022c124d9643957d9bd55f57ac59fce8fa2";
+
hash = "sha256-pZ08gs6wQTZNVDX9uuaQZvw5JKCps8EALegNF0UVV3c=";
};
src_googletest = fetchFromGitHub {
owner = "google";
repo = "googletest";
+
rev = "52eb8108c5bdec04579160ae17225d66034bd723";
+
hash = "sha256-HIHMxAUR4bjmFLoltJeIAVSulVQ6kVuIT2Ku+lwAx/4=";
};
src_googletest_dynolog = fetchFromGitHub {
owner = "google";
···
src_googletest_fbgemm = fetchFromGitHub {
owner = "google";
repo = "googletest";
+
rev = "f8d7d77c06936315286eb55f8de22cd23c188571";
+
hash = "sha256-t0RchAHTJbuI5YW4uyBPykTvcjy90JW9AOPNjIhwh6U=";
};
src_googletest_kineto = fetchFromGitHub {
owner = "google";
···
src_hipify_torch = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "hipify_torch";
+
rev = "a4337c69fe0e2552a7b7b0669178926beeed828c";
+
hash = "sha256-B0+tDjSlZ9C5IAAgteRIgwaJNnptpp1jOP3hTF5AdOw=";
};
src_ideep = fetchFromGitHub {
owner = "intel";
···
src_ittapi = fetchFromGitHub {
owner = "intel";
repo = "ittapi";
+
rev = "dec1d23ca65ab069d225dfe40dea14f455170959";
+
hash = "sha256-aP95qtYi1s8go6HbXW6hDd0XzdWQhOwXLJBNPCIkSCI=";
};
src_json = fetchFromGitHub {
owner = "nlohmann";
repo = "json";
+
rev = "55f93686c01528224f448c19128836e7df245f72";
+
hash = "sha256-cECvDOLxgX7Q9R3IE86Hj9JJUxraDQvhoyPDF03B2CY=";
};
src_json_dynolog = fetchFromGitHub {
owner = "nlohmann";
···
rev = "4f8fba14066156b73f1189a2b8bd568bde5284c5";
hash = "sha256-DTsZrdB9GcaNkx7ZKxcgCA3A9ShM5icSF0xyGguJNbk=";
};
+
src_json_fbgemm = fetchFromGitHub {
+
owner = "nlohmann";
+
repo = "json";
+
rev = "9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03";
+
hash = "sha256-7F0Jon+1oWL7uqet5i1IgHX0fUw/+z0QwEcA3zs5xHg=";
+
};
src_json_opentelemetry-cpp = fetchFromGitHub {
owner = "nlohmann";
repo = "json";
···
src_kineto = fetchFromGitHub {
owner = "pytorch";
repo = "kineto";
+
rev = "5e7501833f1021ce6f618572d3baf657b6319658";
+
hash = "sha256-MQNGrWKU1l/lXo4G2hDFaQeNtyQj+pB5sTqm3piPYrY=";
};
src_kleidiai = fetchFromGitHub {
owner = "ARM-software";
repo = "kleidiai";
+
rev = "cca02c2f69dd18e1f12647c1c0bdc8cf90e680c7";
+
hash = "sha256-+75YvMEJN57cz/jzbqC3E0O7BalfaIfzswRZdpOMx0Q=";
};
src_libnop = fetchFromGitHub {
owner = "google";
···
src_mimalloc = fetchFromGitHub {
owner = "microsoft";
repo = "mimalloc";
+
rev = "94036de6fe20bfd8a73d4a6d142fcf532ea604d9";
+
hash = "sha256-B0gngv16WFLBtrtG5NqA2m5e95bYVcQraeITcOX9A74=";
};
src_mkl-dnn = fetchFromGitHub {
owner = "intel";
···
src_NVTX = fetchFromGitHub {
owner = "NVIDIA";
repo = "NVTX";
+
rev = "2942f167cc30c5e3a44a2aecd5b0d9c07ff61a07";
+
hash = "sha256-MXluy/I5+SaRx2aF64qF4XZ+u67ERAB9TftbOvYt4GE=";
};
src_onnx = fetchFromGitHub {
owner = "onnx";
repo = "onnx";
+
rev = "e709452ef2bbc1d113faf678c24e6d3467696e83";
+
hash = "sha256-UhtF+CWuyv5/Pq/5agLL4Y95YNP63W2BraprhRqJOag=";
};
src_opentelemetry-cpp = fetchFromGitHub {
owner = "open-telemetry";
···
src_pocketfft = fetchFromGitHub {
owner = "mreineck";
repo = "pocketfft";
+
rev = "0fa0ef591e38c2758e3184c6c23e497b9f732ffa";
+
hash = "sha256-Fu786IHiU6Bl66gZ/UJmqOROjlya3viLyzOxwdZVi9c=";
};
src_prometheus-cpp = fetchFromGitHub {
owner = "jupp0r";
···
rev = "a2e59f0e7065404b44dfe92a28aca47ba1378dc4";
hash = "sha256-SNLdtrOjaC3lGHN9MAqTf51U9EzNKQLyTMNPe0GcdrU=";
};
src_pybind11_tensorpipe = fetchFromGitHub {
owner = "pybind";
repo = "pybind11";
···
src_pytorch = fetchFromGitHub {
owner = "pytorch";
repo = "pytorch";
+
rev = "v2.8.0";
+
hash = "sha256-tFEpcgj0HiJcyBiZMtIrBrnmiCJApfTC1BgOXEGvqCo=";
};
src_sleef = fetchFromGitHub {
owner = "shibatch";
repo = "sleef";
+
rev = "5a1d179df9cf652951b59010a2d2075372d67f68";
+
hash = "sha256-bjT+F7/nyiB4f0T06/flbpIWFZbUxjf1TjWMe3112Ig=";
};
src_tensorpipe = fetchFromGitHub {
owner = "pytorch";
···
src_VulkanMemoryAllocator = fetchFromGitHub {
owner = "GPUOpen-LibrariesAndSDKs";
repo = "VulkanMemoryAllocator";
+
rev = "1d8f600fd424278486eade7ed3e877c99f0846b1";
+
hash = "sha256-TPEqV8uHbnyphLG0A+b2tgLDQ6K7a2dOuDHlaFPzTeE=";
};
src_XNNPACK = fetchFromGitHub {
owner = "google";
···
src_civetweb_recursive = src_civetweb;
src_clang-cindex-python3_recursive = src_clang-cindex-python3;
src_composable_kernel_recursive = src_composable_kernel;
+
src_composable_kernel_fbgemm_recursive = src_composable_kernel_fbgemm;
src_composable_kernel_flash-attention_recursive = src_composable_kernel_flash-attention;
src_cpp-httplib_recursive = src_cpp-httplib;
src_cpr_recursive = src_cpr;
···
chmod u+w $out/third_party/pfs
cp -r ${src_pfs_recursive}/* $out/third_party/pfs
'';
src_fbgemm_recursive = runCommand "fbgemm" { } ''
cp -r ${src_fbgemm} $out
+
chmod u+w $out/external/asmjit
+
cp -r ${src_asmjit_recursive}/* $out/external/asmjit
+
chmod u+w $out/external/composable_kernel
+
cp -r ${src_composable_kernel_fbgemm_recursive}/* $out/external/composable_kernel
+
chmod u+w $out/external/cpuinfo
+
cp -r ${src_cpuinfo_fbgemm_recursive}/* $out/external/cpuinfo
+
chmod u+w $out/external/cutlass
+
cp -r ${src_cutlass_fbgemm_recursive}/* $out/external/cutlass
+
chmod u+w $out/external/googletest
+
cp -r ${src_googletest_fbgemm_recursive}/* $out/external/googletest
+
chmod u+w $out/external/hipify_torch
+
cp -r ${src_hipify_torch_recursive}/* $out/external/hipify_torch
+
chmod u+w $out/external/json
+
cp -r ${src_json_fbgemm_recursive}/* $out/external/json
'';
src_fbjni_recursive = src_fbjni;
src_flash-attention_recursive = runCommand "flash-attention" { } ''
···
src_ittapi_recursive = src_ittapi;
src_json_recursive = src_json;
src_json_dynolog_recursive = src_json_dynolog;
+
src_json_fbgemm_recursive = src_json_fbgemm;
src_json_opentelemetry-cpp_recursive = src_json_opentelemetry-cpp;
src_kineto_recursive = runCommand "kineto" { } ''
cp -r ${src_kineto} $out
···
src_onnx_recursive = runCommand "onnx" { } ''
cp -r ${src_onnx} $out
chmod u+w $out/third_party/pybind11
+
cp -r ${src_pybind11_recursive}/* $out/third_party/pybind11
'';
src_opentelemetry-cpp_recursive = runCommand "opentelemetry-cpp" { } ''
cp -r ${src_opentelemetry-cpp} $out
···
src_psimd_recursive = src_psimd;
src_pthreadpool_recursive = src_pthreadpool;
src_pybind11_recursive = src_pybind11;
src_pybind11_tensorpipe_recursive = runCommand "pybind11_tensorpipe" { } ''
cp -r ${src_pybind11_tensorpipe} $out
chmod u+w $out/tools/clang
···
cp -r ${src_cudnn-frontend_recursive}/* $out/third_party/cudnn_frontend
chmod u+w $out/third_party/cutlass
cp -r ${src_cutlass_recursive}/* $out/third_party/cutlass
chmod u+w $out/third_party/fbgemm
cp -r ${src_fbgemm_recursive}/* $out/third_party/fbgemm
chmod u+w $out/third_party/flash-attention