8000 [BE] Get rid of final mentions of BUILD_SPLIT_CUDA · pytorch/pytorch@324ca12 · GitHub
[go: up one dir, main page]

Skip to content

Commit 324ca12

Browse files
committed
[BE] Get rid of final mentions of BUILD_SPLIT_CUDA
BUILD_SPLIT_CUDA logic has been removed for a while Differential Revision: [D78418191](https://our.internmc.facebook.com/intern/diff/D78418191/) ghstack-source-id: 296581624 Pull Request resolved: #158453
1 parent 87c4f0a commit 324ca12

File tree

4 files changed

+9
-29
lines changed

4 files changed

+9
-29
lines changed

.ci/pytorch/windows/internal/smoke_test.bat

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,7 @@ if "%NVIDIA_GPU_EXISTS%" == "0" (
148148
goto end
149149
)
150150

151-
set BUILD_SPLIT_CUDA=
152-
if exist "%install_root%\lib\torch_cuda_cu.lib" if exist "%install_root%\lib\torch_cuda_cpp.lib" set BUILD_SPLIT_CUDA=ON
153-
154-
if "%BUILD_SPLIT_CUDA%" == "ON" (
155-
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
156-
) else (
157-
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
158-
)
151+
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
159152
.\check-torch-cuda.exe
160153
if ERRORLEVEL 1 exit /b 1
161154

aten/src/ATen/templates/RegisterDispatchKey.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#if defined(CAFFE2_BUILD_MAIN_LIB) || \
1010
defined(TORCH_CUDA_BUILD_MAIN_LIB) || \
1111
defined(TORCH_HIP_BUILD_MAIN_LIB) || \
12-
defined(TORCH_XPU_BUILD_MAIN_LIB) || \
13-
defined(TORCH_CUDA_CU_BUILD_MAIN_LIB) || \
14-
defined(TORCH_CUDA_CPP_BUILD_MAIN_LIB)
12+
defined(TORCH_XPU_BUILD_MAIN_LIB)
1513
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
1614
#endif
1715

cmake/Summary.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ function(caffe2_print_configuration_summary)
7070
message(STATUS " USE_CPP_CODE_COVERAGE : ${USE_CPP_CODE_COVERAGE}")
7171
message(STATUS " USE_CUDA : ${USE_CUDA}")
7272
if(${USE_CUDA})
73-
message(STATUS " Split CUDA : ${BUILD_SPLIT_CUDA}")
7473
message(STATUS " CUDA static link : ${CAFFE2_STATIC_LINK_CUDA}")
7574
message(STATUS " USE_CUDNN : ${USE_CUDNN}")
7675
message(STATUS " USE_CUSPARSELT : ${USE_CUSPARSELT}")

torch/headeronly/macros/Export.h

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,12 @@
100100
#define TORCH_API C10_IMPORT
101101
#endif
102102

103-
// You may be wondering: Whose brilliant idea was it to split torch_cuda into
104-
// two pieces with confusing names?
103+
// You may be wondering why we have TORCH_CUDA_CPP_API and TORCH_CUDA_CU_API
104+
// belonging to the same library instead of just one TORCH_CUDA_API. Well, it
105+
// can indeed just be one TORCH_CUDA_API (and used to be)! TORCH_CUDA_CPP_API
106+
// and TORCH_CUDA_CU_API are artifacts of when we needed a split build to
107+
// avoid relocation marker linking errors. The context is as follows:
108+
//
105109
// Once upon a time, there _was_ only TORCH_CUDA_API. All was happy until we
106110
// tried to compile PyTorch for CUDA 11.1, which ran into relocation marker
107111
// issues when linking big binaries.
@@ -116,26 +120,12 @@
116120
// relocation marker issues, we could link our static libraries to a smaller
117121
// part of torch_cuda (torch_cuda_cpp) and avoid the issues.
118122

119-
// libtorch_cuda_cu.so
120-
#ifdef TORCH_CUDA_CU_BUILD_MAIN_LIB
121-
#define TORCH_CUDA_CU_API C10_EXPORT
122-
#elif defined(BUILD_SPLIT_CUDA)
123-
#define TORCH_CUDA_CU_API C10_IMPORT
124-
#endif
125-
126-
// libtorch_cuda_cpp.so
127-
#ifdef TORCH_CUDA_CPP_BUILD_MAIN_LIB
128-
#define TORCH_CUDA_CPP_API C10_EXPORT
129-
#elif defined(BUILD_SPLIT_CUDA)
130-
#define TORCH_CUDA_CPP_API C10_IMPORT
131-
#endif
132-
133123
// libtorch_cuda.so (where torch_cuda_cu and torch_cuda_cpp are a part of the
134124
// same api)
135125
#ifdef TORCH_CUDA_BUILD_MAIN_LIB
136126
#define TORCH_CUDA_CPP_API C10_EXPORT
137127
#define TORCH_CUDA_CU_API C10_EXPORT
138-
#elif !defined(BUILD_SPLIT_CUDA)
128+
#else
139129
#define TORCH_CUDA_CPP_API C10_IMPORT
140130
#define TORCH_CUDA_CU_API C10_IMPORT
141131
#endif

0 commit comments

Comments
 (0)
0