Skip to content

Commit

Permalink
[AOTI] Flag to include aoti sources when building lite interpreter (p…
Browse files Browse the repository at this point in the history
…ytorch#126572)

Summary:
Added USE_LITE_AOTI cmake flag, which is turned OFF by default.
When it is turned on, the AOTI sources  (inductor_core_resources) are included when building lite interpreter

Test Plan:
```
ANDROID_ABI=arm64-v8a ./scripts/build_android.sh -DUSE_LITE_AOTI=ON
```

Differential Revision: D57394078

Pull Request resolved: pytorch#126572
Approved by: https://github.com/malfet
  • Loading branch information
manuelcandales authored and pytorchmergebot committed May 18, 2024
1 parent 2863c76 commit 41fb4bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ endif()
option(USE_SLEEF_FOR_ARM_VEC256 "Use sleef for arm" OFF)
option(USE_SOURCE_DEBUG_ON_MOBILE "Enable" ON)
option(USE_LITE_INTERPRETER_PROFILER "Enable" ON)
cmake_dependent_option(
USE_LITE_AOTI "Include AOTI sources" OFF
"BUILD_LITE_INTERPRETER" OFF)
option(USE_VULKAN_FP16_INFERENCE "Vulkan - Use fp16 inference" OFF)
option(USE_VULKAN_RELAXED_PRECISION "Vulkan - Use relaxed precision math in the kernels (mediump)" OFF)
# option USE_XNNPACK: try to enable xnnpack by default.
Expand Down
3 changes: 3 additions & 0 deletions caffe2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,9 @@ if(BUILD_LITE_INTERPRETER)
append_filelist("libtorch_lite_cmake_sources" LIBTORCH_CMAKE_SRCS)
list(APPEND LIBTORCH_CMAKE_SRCS ${LITE_EAGER_SYMOBLICATION_SRCS})
list(APPEND LIBTORCH_CMAKE_SRCS ${LITE_PROFILER_SRCS})
if(USE_LITE_AOTI)
append_filelist("inductor_core_resources" LIBTORCH_CMAKE_SRCS)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
else()
append_filelist("libtorch_cmake_sources" LIBTORCH_CMAKE_SRCS)
Expand Down

0 comments on commit 41fb4bc

Please sign in to comment.