mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE] Get rid of final mentions of BUILD_SPLIT_CUDA (#158453)
BUILD_SPLIT_CUDA logic has been removed for a while Differential Revision: [D78418191](https://our.internmc.facebook.com/intern/diff/D78418191/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/158453 Approved by: https://github.com/albanD ghstack dependencies: #158358, #158365
This commit is contained in:
committed by
PyTorch MergeBot
parent
a38f433be2
commit
09db3a22e8
@ -148,14 +148,7 @@ if "%NVIDIA_GPU_EXISTS%" == "0" (
|
||||
goto end
|
||||
)
|
||||
|
||||
set BUILD_SPLIT_CUDA=
|
||||
if exist "%install_root%\lib\torch_cuda_cu.lib" if exist "%install_root%\lib\torch_cuda_cpp.lib" set BUILD_SPLIT_CUDA=ON
|
||||
|
||||
if "%BUILD_SPLIT_CUDA%" == "ON" (
|
||||
cl %PYTORCH_ROOT%\.ci\pytorch\test_example_code\check-torch-cuda.cpp torch_cpu.lib c10.lib torch_cuda_cu.lib torch_cuda_cpp.lib /EHsc /std:c++17 /link /INCLUDE:?warp_size@cuda@at@@YAHXZ /INCLUDE:?_torch_cuda_cu_linker_symbol_op_cuda@native@at@@YA?AVTensor@2@AEBV32@@Z
|
||||
) else (
|
||||
cl %PYTORCH_ROOT%\.ci\pytorch\test_example_code\check-torch-cuda.cpp torch_cpu.lib c10.lib torch_cuda.lib /EHsc /std:c++17 /link /INCLUDE:?warp_size@cuda@at@@YAHXZ
|
||||
)
|
||||
cl %PYTORCH_ROOT%\.ci\pytorch\test_example_code\check-torch-cuda.cpp torch_cpu.lib c10.lib torch_cuda.lib /EHsc /std:c++17 /link /INCLUDE:?warp_size@cuda@at@@YAHXZ
|
||||
.\check-torch-cuda.exe
|
||||
if ERRORLEVEL 1 exit /b 1
|
||||
|
||||
|
@ -9,9 +9,7 @@
|
||||
#if defined(CAFFE2_BUILD_MAIN_LIB) || \
|
||||
defined(TORCH_CUDA_BUILD_MAIN_LIB) || \
|
||||
defined(TORCH_HIP_BUILD_MAIN_LIB) || \
|
||||
defined(TORCH_XPU_BUILD_MAIN_LIB) || \
|
||||
defined(TORCH_CUDA_CU_BUILD_MAIN_LIB) || \
|
||||
defined(TORCH_CUDA_CPP_BUILD_MAIN_LIB)
|
||||
defined(TORCH_XPU_BUILD_MAIN_LIB)
|
||||
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
|
||||
#endif
|
||||
|
||||
|
@ -70,7 +70,6 @@ function(caffe2_print_configuration_summary)
|
||||
message(STATUS " USE_CPP_CODE_COVERAGE : ${USE_CPP_CODE_COVERAGE}")
|
||||
message(STATUS " USE_CUDA : ${USE_CUDA}")
|
||||
if(${USE_CUDA})
|
||||
message(STATUS " Split CUDA : ${BUILD_SPLIT_CUDA}")
|
||||
message(STATUS " CUDA static link : ${CAFFE2_STATIC_LINK_CUDA}")
|
||||
message(STATUS " USE_CUDNN : ${USE_CUDNN}")
|
||||
message(STATUS " USE_CUSPARSELT : ${USE_CUSPARSELT}")
|
||||
|
@ -100,8 +100,12 @@
|
||||
#define TORCH_API C10_IMPORT
|
||||
#endif
|
||||
|
||||
// You may be wondering: Whose brilliant idea was it to split torch_cuda into
|
||||
// two pieces with confusing names?
|
||||
// You may be wondering why we have TORCH_CUDA_CPP_API and TORCH_CUDA_CU_API
|
||||
// belonging to the same library instead of just one TORCH_CUDA_API. Well, it
|
||||
// can indeed just be one TORCH_CUDA_API (and used to be)! TORCH_CUDA_CPP_API
|
||||
// and TORCH_CUDA_CU_API are artifacts of when we needed a split build to
|
||||
// avoid relocation marker linking errors. The context is as follows:
|
||||
//
|
||||
// Once upon a time, there _was_ only TORCH_CUDA_API. All was happy until we
|
||||
// tried to compile PyTorch for CUDA 11.1, which ran into relocation marker
|
||||
// issues when linking big binaries.
|
||||
@ -116,26 +120,12 @@
|
||||
// relocation marker issues, we could link our static libraries to a smaller
|
||||
// part of torch_cuda (torch_cuda_cpp) and avoid the issues.
|
||||
|
||||
// libtorch_cuda_cu.so
|
||||
#ifdef TORCH_CUDA_CU_BUILD_MAIN_LIB
|
||||
#define TORCH_CUDA_CU_API C10_EXPORT
|
||||
#elif defined(BUILD_SPLIT_CUDA)
|
||||
#define TORCH_CUDA_CU_API C10_IMPORT
|
||||
#endif
|
||||
|
||||
// libtorch_cuda_cpp.so
|
||||
#ifdef TORCH_CUDA_CPP_BUILD_MAIN_LIB
|
||||
#define TORCH_CUDA_CPP_API C10_EXPORT
|
||||
#elif defined(BUILD_SPLIT_CUDA)
|
||||
#define TORCH_CUDA_CPP_API C10_IMPORT
|
||||
#endif
|
||||
|
||||
// libtorch_cuda.so (where torch_cuda_cu and torch_cuda_cpp are a part of the
|
||||
// same api)
|
||||
#ifdef TORCH_CUDA_BUILD_MAIN_LIB
|
||||
#define TORCH_CUDA_CPP_API C10_EXPORT
|
||||
#define TORCH_CUDA_CU_API C10_EXPORT
|
||||
#elif !defined(BUILD_SPLIT_CUDA)
|
||||
#else
|
||||
#define TORCH_CUDA_CPP_API C10_IMPORT
|
||||
#define TORCH_CUDA_CU_API C10_IMPORT
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user