mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Don't build CUDA with debug info by default. (#102617)
Fixes https://github.com/pytorch/pytorch/issues/102594 Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/102617 Approved by: https://github.com/malfet
This commit is contained in:
parent
0cee4e3c32
commit
3dc4adc7a6
|
|
@ -340,6 +340,7 @@ option(HAVE_SOVERSION "Whether to add SOVERSION to the shared objects" OFF)
|
|||
option(BUILD_LIBTORCH_CPU_WITH_DEBUG "Enable RelWithDebInfo for libtorch_cpu target only" OFF)
|
||||
cmake_dependent_option(USE_CCACHE "Attempt using CCache to wrap the compilation" ON "UNIX" OFF)
|
||||
option(WERROR "Build with -Werror supported by the compiler" OFF)
|
||||
option(DEBUG_CUDA "When compiling DEBUG, also attempt to compile CUDA with debug flags (may cause nvcc to OOM)" OFF)
|
||||
option(USE_COREML_DELEGATE "Use the CoreML backend through delegate APIs" OFF)
|
||||
option(USE_PER_OPERATOR_HEADERS "Whether ATen should generate separate headers for each operator" ON)
|
||||
cmake_dependent_option(
|
||||
|
|
@ -722,7 +723,7 @@ cmake_dependent_option(
|
|||
"Whether to build the flash_attention kernel for scaled dot product attention" ON
|
||||
"USE_CUDA AND NOT ROCM AND NOT CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.6" OFF)
|
||||
|
||||
if(NOT MSVC)
|
||||
if(DEBUG_CUDA)
|
||||
string(APPEND CMAKE_CUDA_FLAGS_DEBUG " -lineinfo")
|
||||
string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO " -lineinfo")
|
||||
# CUDA-12.1 crashes when trying to compile with --source-in-ptx
|
||||
|
|
|
|||
5
setup.py
5
setup.py
|
|
@ -25,6 +25,11 @@
|
|||
#
|
||||
# Environment variables for feature toggles:
|
||||
#
|
||||
# DEBUG_CUDA=1
|
||||
# if used in conjunction with DEBUG or REL_WITH_DEB_INFO, will also
|
||||
# build CUDA kernels with -lineinfo --source-in-ptx. Note that
|
||||
# on CUDA 12 this may cause nvcc to OOM, so this is disabled by default.
|
||||
#
|
||||
# USE_CUDNN=0
|
||||
# disables the cuDNN build
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user