Skip to content

Commit 0c87468

Browse files
authored
removed etensor maker in cuda backend
Differential Revision: D92799750 Pull Request resolved: pytorch#17325
1 parent 1078a15 commit 0c87468

4 files changed

Lines changed: 7 additions & 239 deletions

File tree

‎backends/cuda/CMakeLists.txt‎

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -78,35 +78,6 @@ endif()
7878
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
7979
find_package_torch()
8080

81-
# CUDA tensor maker for backends that support incontiguous tensors
82-
set(_tensor_maker_sources runtime/tensor/tensor_maker.cpp)
83-
add_library(cuda_tensor_maker STATIC ${_tensor_maker_sources})
84-
target_include_directories(
85-
cuda_tensor_maker
86-
PUBLIC $<BUILD_INTERFACE:${EXECUTORCH_ROOT}> $<INSTALL_INTERFACE:include>
87-
$<BUILD_INTERFACE:${EXECUTORCH_ROOT}/..>
88-
)
89-
target_compile_options(
90-
cuda_tensor_maker
91-
PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${_cuda_cxx_compile_options}>"
92-
)
93-
# Ensure symbols are exported properly
94-
if(_cuda_export_dynamic_option)
95-
target_link_options(cuda_tensor_maker PUBLIC ${_cuda_export_dynamic_option})
96-
endif()
97-
98-
# Link against ExecuTorch core libraries
99-
target_link_libraries(
100-
cuda_tensor_maker PRIVATE executorch_core ${CMAKE_DL_LIBS}
101-
)
102-
executorch_target_link_options_shared_lib(cuda_tensor_maker)
103-
104-
install(
105-
TARGETS cuda_tensor_maker
106-
EXPORT ExecuTorchTargets
107-
DESTINATION lib
108-
)
109-
11081
# Platform utilities (load_library, close_library, etc.)
11182
set(_cuda_platform_sources runtime/platform/platform.cpp)
11283
add_library(cuda_platform STATIC ${_cuda_platform_sources})
@@ -174,13 +145,12 @@ if(_cuda_export_dynamic_option)
174145
target_link_options(aoti_cuda_shims PUBLIC ${_cuda_export_dynamic_option})
175146
endif()
176147

177-
# Link against CUDA::cudart, common AOTI library, cuda_tensor_maker, and
178-
# platform utilities. On non-MSVC, use --whole-archive for
179-
# aoti_common_shims_slim to force shim symbol retention.
148+
# Link against CUDA::cudart, common AOTI library, and platform utilities. On
149+
# non-MSVC, use --whole-archive for aoti_common_shims_slim to force shim symbol
150+
# retention.
180151
if(_cuda_is_msvc_toolchain)
181152
target_link_libraries(
182-
aoti_cuda_shims PRIVATE cuda_platform cuda_tensor_maker CUDA::cudart
183-
${CMAKE_DL_LIBS}
153+
aoti_cuda_shims PRIVATE cuda_platform CUDA::cudart ${CMAKE_DL_LIBS}
184154
)
185155
# Link object library directly so symbols are pulled exactly once while
186156
# avoiding duplicate static/object inclusion and interface leakage.
@@ -190,7 +160,7 @@ else()
190160
aoti_cuda_shims
191161
PRIVATE cuda_platform
192162
PUBLIC -Wl,--whole-archive aoti_common_shims_slim -Wl,--no-whole-archive
193-
cuda_tensor_maker CUDA::cudart ${CMAKE_DL_LIBS}
163+
CUDA::cudart ${CMAKE_DL_LIBS}
194164
)
195165
endif()
196166

@@ -229,8 +199,8 @@ endif()
229199
# directory. On other platforms, use PUBLIC so the dependency propagates to
230200
# consumers.
231201
target_link_libraries(
232-
aoti_cuda_backend PUBLIC cuda_platform extension_tensor cuda_tensor_maker
233-
CUDA::cudart ${CMAKE_DL_LIBS}
202+
aoti_cuda_backend PUBLIC cuda_platform extension_tensor CUDA::cudart
203+
${CMAKE_DL_LIBS}
234204
)
235205

236206
if(_cuda_is_msvc_toolchain)

‎backends/cuda/runtime/TARGETS‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,6 @@ runtime.cxx_library(
2727
],
2828
)
2929

30-
runtime.cxx_library(
31-
name = "tensor_maker",
32-
srcs = [
33-
"tensor/tensor_maker.cpp",
34-
],
35-
headers = [
36-
"tensor/tensor_maker.h",
37-
],
38-
# @lint-ignore BUCKLINT: Avoid `link_whole=True` (https://fburl.com/avoid-link-whole)
39-
link_whole = True,
40-
supports_python_dlopen = True,
41-
visibility = ["PUBLIC"],
42-
deps = [
43-
"//executorch/runtime/core:core",
44-
"//executorch/runtime/core/exec_aten:lib",
45-
"//executorch/runtime/core/exec_aten/util:tensor_util",
46-
],
47-
)
48-
4930
runtime.cxx_library(
5031
name = "runtime_shims",
5132
srcs = [
@@ -70,7 +51,6 @@ runtime.cxx_library(
7051
preprocessor_flags = ["-DCUDA_AVAILABLE=1"],
7152
visibility = ["PUBLIC"],
7253
deps = [
73-
":tensor_maker",
7454
"//executorch/backends/aoti:aoti_common_slim",
7555
"//executorch/backends/aoti/slim/core:slimtensor",
7656
"//executorch/backends/aoti/slim/factory:empty",

‎backends/cuda/runtime/tensor/tensor_maker.cpp‎

Lines changed: 0 additions & 126 deletions
This file was deleted.

‎backends/cuda/runtime/tensor/tensor_maker.h‎

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)