Skip to content

Commit 0bbf0be

Browse files
lucylqmalfet
authored andcommitted
update et.cmake for native (#712)
1 parent e503d7a commit 0bbf0be

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

.github/workflows/pull.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -915,9 +915,8 @@ jobs:
915915
- if: ${{ steps.install-et.outputs.cache-hit != 'true' }}
916916
continue-on-error: true
917917
run: |
918-
echo "Intalling ExecuTorch"
919-
export TORCHCHAT_ROOT=${PWD}
920-
bash scripts/install_et.sh
918+
echo "Installing ExecuTorch"
919+
bash scripts/build_native.sh et
921920
- name: Install ET pip
922921
run: |
923922
echo "ET build directory"

runner/build_android.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export CMAKE_OUT_DIR="cmake-out-android"
3030
build_runner_et() {
3131
rm -rf cmake-out-android
3232
echo "ET BUILD DIR IS ${ET_BUILD_DIR}"
33-
cmake -DET_USE_ADPATIVE_THREADS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -S . -B cmake-out-android -G Ninja
33+
cmake -DET_USE_ADAPTIVE_THREADS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -S . -B cmake-out-android -G Ninja
3434
cmake --build cmake-out-android/ -j16 --config Release --target et_run
3535
}
3636

runner/et.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ if(executorch_FOUND)
5050

5151
set(_srcs runner/run.cpp)
5252
set(_common_compile_options -D__ET__MODEL -D_GLIBCXX_USE_CXX11_ABI=1)
53-
if(ET_USE_ADPATIVE_THREADS)
54-
list(APPEND _common_compile_options -DET_USE_ADPATIVE_THREADS)
53+
if(ET_USE_ADAPTIVE_THREADS)
54+
list(APPEND _common_compile_options -DET_USE_ADAPTIVE_THREADS)
5555

5656
set(EXECUTORCH_SRC_ROOT ${TORCHCHAT_ROOT}/${ET_BUILD_DIR}/src/executorch)
5757
set(XNNPACK_ROOT ${EXECUTORCH_SRC_ROOT}/backends/xnnpack)

runner/run.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ torch::Device cpu_device(torch::kCPU);
3333
#include <executorch/runtime/core/exec_aten/exec_aten.h>
3434
#include <executorch/runtime/core/exec_aten/util/scalar_type_util.h>
3535

36-
#if defined(ET_USE_ADPATIVE_THREADS)
36+
#if defined(ET_USE_ADAPTIVE_THREADS)
3737
#include <executorch/backends/xnnpack/threadpool/cpuinfo_utils.h>
3838
#include <executorch/backends/xnnpack/threadpool/threadpool.h>
3939
#endif
@@ -823,7 +823,7 @@ int main(int argc, char* argv[]) {
823823
int vocab_size = -1;
824824
int llama_ver = 2;
825825

826-
#if defined(ET_USE_ADPATIVE_THREADS)
826+
#if defined(ET_USE_ADAPTIVE_THREADS)
827827
uint32_t num_performant_cores =
828828
torch::executorch::cpuinfo::get_num_performant_cores();
829829
if (num_performant_cores > 0) {

scripts/install_utils.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ clone_executorch() {
3838
install_executorch_python_libs() {
3939
if [ ! -d "${TORCHCHAT_ROOT}/${ET_BUILD_DIR}" ]; then
4040
echo "Directory ${TORCHCHAT_ROOT}/${ET_BUILD_DIR} does not exist."
41-
echo "Make sur eyou run clone_executorch"
41+
echo "Make sure you run clone_executorch"
4242
exit 1
4343
fi
4444
pushd ${TORCHCHAT_ROOT}/${ET_BUILD_DIR}/src
@@ -63,7 +63,8 @@ COMMON_CMAKE_ARGS="\
6363
-DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
6464
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
6565
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
66-
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON"
66+
-DEXECUTORCH_BUILD_KERNELS_QUANTIZED=ON \
67+
-DEXECUTORCH_BUILD_XNNPACK=ON"
6768

6869
install_executorch() {
6970
# AOT lib has to be build for model export

0 commit comments

Comments
 (0)