Skip to content

Commit fbf5b6e

Browse files
committed
ip
1 parent eb97fa8 commit fbf5b6e

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -833,13 +833,13 @@ if(EXECUTORCH_BUILD_VULKAN)
833833
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/vulkan)
834834
endif()
835835

836-
if(EXECUTORCH_BUILD_TORCHAO)
837-
add_compile_options("-frtti")
838-
set(EXECUTORCH_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/..)
839-
set(EXECUTORCH_LIBRARIES executorch extension_threadpool) # cpuinfo pthreadpool)
840-
set(TORCHAO_BUILD_EXECUTORCH_OPS ON)
841-
add_subdirectory(third-party/ao/torchao/experimental)
842-
endif()
836+
# if(EXECUTORCH_BUILD_TORCHAO)
837+
# add_compile_options("-frtti")
838+
# set(EXECUTORCH_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/..)
839+
# set(EXECUTORCH_LIBRARIES executorch extension_threadpool) # cpuinfo pthreadpool)
840+
# set(TORCHAO_BUILD_EXECUTORCH_OPS ON)
841+
# add_subdirectory(third-party/ao/torchao/experimental)
842+
# endif()
843843

844844
# Print all summary
845845
executorch_print_configuration_summary()

examples/models/llama2/CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,20 @@ if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
122122
endif()
123123

124124
if(EXECUTORCH_BUILD_TORCHAO)
125-
set(torchao_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/torchao)
126-
find_package(torchao REQUIRED)
127-
target_link_options_shared_lib(torchao::torchao_ops_executorch)
128-
list(APPEND link_libraries torchao::torchao_ops_executorch)
125+
# Method1: torchao has a config
126+
# set(torchao_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/torchao)
127+
# find_package(torchao REQUIRED)
128+
# target_link_options_shared_lib(torchao::torchao_ops_executorch)
129+
# list(APPEND link_libraries torchao::torchao_ops_executorch)
130+
131+
# Method2: torchao is built at top-level CMakeLists.txt
129132
# list(APPEND link_libraries "$<LINK_LIBRARY:WHOLE_ARCHIVE,${CMAKE_CURRENT_BINARY_DIR}/../../../lib/libtorchao_ops_executorch.a>")
130133
# list(APPEND link_libraries "${CMAKE_CURRENT_BINARY_DIR}/../../../lib/libtorchao_kernels_aarch64.a")
134+
135+
# Method3: submodule
136+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../third-party/ao/torchao/experimental ${CMAKE_CURRENT_BINARY_DIR}/../../../third-party/ao/torchao/experimental)
137+
target_link_options_shared_lib(torchao_ops_executorch)
138+
list(APPEND link_libraries torchao_ops_executorch)
131139
endif()
132140

133141
set(XNNPACK_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../backends/xnnpack)

0 commit comments

Comments
 (0)