Skip to content

Commit d1dec35

Browse files
committed
Revert "Fix multiple MKL targets"
This reverts commit bcf317c.
1 parent bcf317c commit d1dec35

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,6 @@ target_compile_definitions(executorch PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
602602
target_compile_options(executorch PUBLIC ${_common_compile_options})
603603
target_link_options_shared_lib(executorch)
604604

605-
#
606-
# find pytorch lib here to make it available to all sub-directories, trying to
607-
# call find_package(Torch) multiple times doesn't work because it brings in MKL
608-
# which is defined once globally
609-
#
610-
find_package(Torch CONFIG REQUIRED)
611-
612605
#
613606
# portable_ops_lib: A library to register core ATen ops using portable kernels,
614607
# see kernels/portable/CMakeLists.txt.
@@ -756,7 +749,8 @@ if(EXECUTORCH_BUILD_PYBIND)
756749
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/devtools)
757750
endif()
758751

759-
# to allow pybind to take at::Tensor as input/output
752+
# find pytorch lib, to allow pybind to take at::Tensor as input/output
753+
find_package(Torch CONFIG REQUIRED)
760754
find_library(
761755
TORCH_PYTHON_LIBRARY torch_python PATHS "${TORCH_INSTALL_PREFIX}/lib"
762756
)

build/Codegen.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@ function(gen_custom_ops_aot_lib)
146146
${_out_dir}/CustomOpsNativeFunctions.h "${GEN_KERNEL_SOURCES}"
147147
)
148148
# Find `Torch`.
149-
if(NOT TARGET torch)
150-
find_package(Torch REQUIRED)
151-
endif()
149+
find_package(Torch REQUIRED)
152150
# This lib uses ATen lib, so we explicitly enable rtti and exceptions.
153151
target_compile_options(${GEN_LIB_NAME} PRIVATE -frtti -fexceptions)
154152
target_compile_definitions(${GEN_LIB_NAME} PRIVATE USE_ATEN_LIB=1)

extension/llm/custom_ops/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ install(TARGETS custom_ops DESTINATION lib)
6969

7070
if(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT)
7171
# Add a AOT library
72-
if(NOT TARGET torch)
73-
find_package(Torch CONFIG REQUIRED)
74-
endif()
72+
find_package(Torch CONFIG REQUIRED)
7573
add_library(
7674
custom_ops_aot_lib SHARED
7775
${_custom_ops__srcs}

0 commit comments

Comments
 (0)