Skip to content

Commit ee74c2e

Browse files
zasdfgbnmfacebook-github-bot
authored andcommitted
Compress fatbin to fit into 32bit indexing (#43074)
Summary: Fixes #39968 tested with `TORCH_CUDA_ARCH_LIST='3.5 5.2 6.0 6.1 7.0 7.5 8.0+PTX'`, before this PR, it was failing, and with this PR, the build succeed. With `TORCH_CUDA_ARCH_LIST='7.0 7.5 8.0+PTX'`, `libtorch_cuda.so` with symbols changes from 2.9GB -> 2.2GB cc: ptrblck mcarilli jjsjann123 Pull Request resolved: #43074 Reviewed By: mrshenli Differential Revision: D23176095 Pulled By: malfet fbshipit-source-id: 7b3e6d049fc080e519f21e80df05ef68e7bea57e
1 parent b92b556 commit ee74c2e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ if(MSVC)
357357
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler /w -w")
358358
endif(MSVC)
359359

360+
list(APPEND CUDA_NVCC_FLAGS "-Xfatbin" "-compress-all")
361+
list(APPEND CUDA_NVCC_FLAGS_DEBUG "-Xfatbin" "-compress-all")
362+
list(APPEND CUDA_NVCC_FLAGS_RELWITHDEBINFO "-Xfatbin" "-compress-all")
363+
360364
if(NOT MSVC)
361365
list(APPEND CUDA_NVCC_FLAGS_DEBUG "-g" "-lineinfo" "--source-in-ptx")
362366
list(APPEND CUDA_NVCC_FLAGS_RELWITHDEBINFO "-g" "-lineinfo" "--source-in-ptx")

0 commit comments

Comments
 (0)