Skip to content

Commit 22da391

Browse files
committed
updates
1 parent f0a4949 commit 22da391

File tree

2 files changed

+4
-32
lines changed

2 files changed

+4
-32
lines changed

CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,10 +837,9 @@ if(EXECUTORCH_BUILD_VULKAN)
837837
endif()
838838

839839
if(EXECUTORCH_BUILD_TORCHAO)
840-
find_package(Torch CONFIG REQUIRED HINT ${CMAKE_PREFIX_PATH}/torch/share/cmake/Torch)
841-
# set(executorch_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../lib/cmake/ExecuTorch)
842840
add_compile_options("-frtti")
843-
set(Torch_DIR /opt/miniconda3/envs/et_env/lib/python3.10/site-packages/torch/share/cmake/Torch)
841+
set(EXECUTORCH_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/..)
842+
set(EXECUTORCH_LIBRARIES executorch extension_threadpool cpuinfo pthreadpool)
844843
set(TORCHAO_BUILD_EXECUTORCH_OPS ON)
845844
add_subdirectory(third-party/ao/torchao/experimental)
846845
endif()

examples/models/llama/CMakeLists.txt

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -122,35 +122,8 @@ if(EXECUTORCH_BUILD_KERNELS_CUSTOM)
122122
endif()
123123

124124
if(EXECUTORCH_BUILD_TORCHAO)
125-
include(ExternalProject)
126-
# set(TORCHAO_BUILD_EXECUTORCH_OPS ON)
127-
128-
ExternalProject_Add(
129-
torchao
130-
PREFIX ${CMAKE_BINARY_DIR}/../../../third-party/ao/torchao/experimental
131-
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../third-party/ao/torchao/experimental
132-
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=cmake-out
133-
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
134-
-DTORCHAO_BUILD_EXECUTORCH_OPS=ON
135-
-DEXECUTORCH_INCLUDE_DIRS=$HOME/repos
136-
-DEXECUTORCH_LIBRARIES=${CMAKE_BINARY_DIR}/lib/libexecutorch.a;$HOME/repos/executorch/cmake-out/lib/libextension_threadpool.a;$HOME/repos/executorch/cmake-out/lib/libcpuinfo.a;$HOME/repos/executorch/cmake-out/lib/libpthreadpool.a
137-
)
138-
set(TORCHAO_BUILD_EXECUTORCH_OPS ON)
139-
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../third-party/ao/torchao/experimental ${CMAKE_CURRENT_BINARY_DIR}/../../../third-party/ao/torchao/experimental)
140-
141-
set(torchao_DIR /Users/scroy/repos/executorch/cmake-out/lib/cmake/torchao)
142-
find_package(torchao REQUIRED)
143-
144-
# set(torchao_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../third-party/ao/torchao/experimental)
145-
# find_package(torchao CONFIG REQUIRED)
146-
147-
# find_package(Torch CONFIG REQUIRED HINT ${CMAKE_PREFIX_PATH}/torch/share/cmake/Torch)
148-
# add_compile_options("-frtti")
149-
# set(Torch_DIR /opt/miniconda3/envs/et_env/lib/python3.10/site-packages/torch/share/cmake/Torch)
150-
151-
# add_subdirectory(third-party/ao/torchao/experimental)
152-
target_link_options_shared_lib(torchao::torchao_ops_executorch)
153-
list(APPEND link_libraries torchao::torchao_ops_executorch)
125+
list(APPEND link_libraries "$<LINK_LIBRARY:WHOLE_ARCHIVE,${CMAKE_CURRENT_BINARY_DIR}/../../../lib/libtorchao_ops_executorch.a>")
126+
list(APPEND link_libraries "${CMAKE_CURRENT_BINARY_DIR}/../../../lib/libtorchao_kernels_aarch64.a")
154127
endif()
155128

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

0 commit comments

Comments
 (0)