Skip to content

Commit

Permalink
fix: add pytorch fatbin patch
Browse files Browse the repository at this point in the history
  • Loading branch information
sileht committed Oct 15, 2020
1 parent cf7d354 commit 43a698c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ if (USE_TORCH)
${PYTORCH_PATCHES_PATH}/pytorch_15_compile.patch
${PYTORCH_PATCHES_PATH}/pytorch_16_logging.patch
${PYTORCH_PATCHES_PATH}/pytorch_14_namespace.patch
${PYTORCH_PATCHES_PATH}/pytorch_16_fatbin.patch
)

include_directories("${PROTOBUF_INCLUDE_DIR}")
Expand Down
18 changes: 18 additions & 0 deletions patches/pytorch/pytorch_16_fatbin.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

From: https://github.com/pytorch/pytorch/pull/43074

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45fce7f44a696..869a6aee1a836 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -357,6 +357,10 @@ if(MSVC)
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler /w -w")
endif(MSVC)

+list(APPEND CUDA_NVCC_FLAGS "-Xfatbin" "-compress-all")
+list(APPEND CUDA_NVCC_FLAGS_DEBUG "-Xfatbin" "-compress-all")
+list(APPEND CUDA_NVCC_FLAGS_RELWITHDEBINFO "-Xfatbin" "-compress-all")
+
if(NOT MSVC)
list(APPEND CUDA_NVCC_FLAGS_DEBUG "-g" "-lineinfo" "--source-in-ptx")
list(APPEND CUDA_NVCC_FLAGS_RELWITHDEBINFO "-g" "-lineinfo" "--source-in-ptx")

0 comments on commit 43a698c

Please sign in to comment.