Skip to content

Commit 8384d26

Browse files
Remove unnecessary Torch dependency from ExecuTorch ops build
The ExecuTorch ops target defines TORCHAO_SHARED_KERNELS_BUILD_EXECUTORCH=1, which means shared kernel headers use ExecuTorch includes, not Torch includes. The find_package(Torch) and TORCH_INCLUDE_DIRS were therefore unnecessary and caused CMake configure failures in standalone ExecuTorch builds where PyTorch is not discoverable via find_package.
1 parent afb2844 commit 8384d26

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

torchao/csrc/cpu/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ endif()
197197

198198
# Build ExecuTorch ops
199199
if(TORCHAO_BUILD_EXECUTORCH_OPS)
200-
find_package(Torch REQUIRED)
201200
# ExecuTorch package is not required, but EXECUTORCH_INCLUDE_DIRS and EXECUTORCH_LIBRARIES must
202201
# be defined and EXECUTORCH_LIBRARIES must include the following libraries installed by ExecuTorch:
203202
# libexecutorch.a
@@ -230,5 +229,4 @@ if(TORCHAO_BUILD_EXECUTORCH_OPS)
230229
endif()
231230
endif()
232231
target_link_libraries(torchao_ops_executorch PRIVATE cpuinfo)
233-
target_include_directories(torchao_ops_executorch PRIVATE "${TORCH_INCLUDE_DIRS}")
234232
endif()

0 commit comments

Comments
 (0)