Commit 81914ea5 authored by Connor Baker's avatar Connor Baker
Browse files

python3Packages.torch: check in patch for PyTorch PR 108847

parent 2ab8359b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -145,10 +145,8 @@ in buildPythonPackage rec {
    ./pthreadpool-disable-gcd.diff
  ] ++ lib.optionals stdenv.isLinux [
    # Propagate CUPTI to Kineto by overriding the search path with environment variables.
    (fetchpatch {
      url = "https://github.com/pytorch/pytorch/pull/108847/commits/7ae4d7c0e2dec358b4fe81538efe9da5eb580ec9.patch";
      hash = "sha256-skFaDg98xcJqJfzxWk+qhUxPLHDStqvd0mec3PgksIg=";
    })
    # https://github.com/pytorch/pytorch/pull/108847
    ./pytorch-pr-108847.patch
  ];

  postPatch = lib.optionalString rocmSupport ''
+31 −0
Original line number Diff line number Diff line
From bf4050edab9f294a8e0060c47f906cd7a80f25a2 Mon Sep 17 00:00:00 2001
From: Samuel Ainsworth <skainsworth@gmail.com>
Date: Sat, 9 Sep 2023 02:04:09 +0000
Subject: [PATCH] Dependencies.cmake: support building against CUPTI outside of
 CUDA_SOURCE_DIR

Limitation discovered in https://github.com/NixOS/nixpkgs/pull/249259.
---
 cmake/Dependencies.cmake | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index 0602d534dc4c14..5f6a5f79f3e3dc 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -1879,6 +1879,7 @@ if(USE_KINETO)
         ${CUDA_SOURCE_DIR}/extras/CUPTI/lib64
         ${CUDA_SOURCE_DIR}/lib
         ${CUDA_SOURCE_DIR}/lib64
+        $ENV{CUPTI_LIBRARY_DIR}
         NO_DEFAULT_PATH)
 
     find_path(CUPTI_INCLUDE_DIR cupti.h PATHS
@@ -1886,6 +1887,7 @@ if(USE_KINETO)
         ${CUDA_INCLUDE_DIRS}
         ${CUDA_SOURCE_DIR}
         ${CUDA_SOURCE_DIR}/include
+        $ENV{CUPTI_INCLUDE_DIR}
         NO_DEFAULT_PATH)
 
     if(CUPTI_LIBRARY_PATH AND CUPTI_INCLUDE_DIR)