Skip to content

Commit 6e2705e

Browse files
digantdesaifacebook-github-bot
authored andcommitted
Arm CI fix (#2771)
Summary: Pull Request resolved: #2771 - buck issue with inotify limit. Default is 8K. 24K seems to work. Setting it to 1M. Didn't investigate further. - top CMake always building cpuinfo and threadpool. Added an option to turn it off with ARM_BAREMETAL - arm example building w/o ARM_BAREMETAL. Added that. Reviewed By: shoumikhin, Gasoonjia, mikekgfb Differential Revision: D55538019 fbshipit-source-id: 1a22504d157e47a1052e9b49ca28d56eb5eb22c5
1 parent f353405 commit 6e2705e

File tree

4 files changed

+67
-39
lines changed

4 files changed

+67
-39
lines changed

.github/workflows/trunk.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ jobs:
159159
git config --global user.name "Github Executorch"
160160
bash examples/arm/setup.sh --i-agree-to-the-contained-eula
161161
162+
# Increase number of files user can monitor to bypass buck failures.
163+
# Hopefully this is high enough for this setup.
164+
sudo sysctl fs.inotify.max_user_watches=1048576 # 1024 * 1024
165+
162166
# Test ethos-u delegate examples with run.sh
163167
source examples/arm/ethos-u-scratch/setup_path.sh
164168
PYTHON_EXECUTABLE=python bash examples/arm/run.sh examples/arm/ethos-u-scratch/ buck2

CMakeLists.txt

Lines changed: 55 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -56,45 +56,6 @@ if(NOT CMAKE_BUILD_TYPE)
5656
set(CMAKE_BUILD_TYPE Debug)
5757
endif()
5858

59-
# --- cpuinfo
60-
set(CPUINFO_SOURCE_DIR "backends/xnnpack/third-party/cpuinfo")
61-
set(CPUINFO_BUILD_TOOLS
62-
OFF
63-
CACHE BOOL "")
64-
set(CPUINFO_BUILD_UNIT_TESTS
65-
OFF
66-
CACHE BOOL "")
67-
set(CPUINFO_BUILD_MOCK_TESTS
68-
OFF
69-
CACHE BOOL "")
70-
set(CPUINFO_BUILD_BENCHMARKS
71-
OFF
72-
CACHE BOOL "")
73-
set(CPUINFO_LIBRARY_TYPE
74-
"static"
75-
CACHE STRING "")
76-
set(CPUINFO_LOG_LEVEL
77-
"error"
78-
CACHE STRING "")
79-
set(CLOG_SOURCE_DIR "${CPUINFO_SOURCE_DIR}/deps/clog")
80-
add_subdirectory("${CPUINFO_SOURCE_DIR}")
81-
82-
# --- pthreadpool
83-
set(PTHREADPOOL_SOURCE_DIR "backends/xnnpack/third-party/pthreadpool")
84-
set(PTHREADPOOL_BUILD_TESTS
85-
OFF
86-
CACHE BOOL "")
87-
set(PTHREADPOOL_BUILD_BENCHMARKS
88-
OFF
89-
CACHE BOOL "")
90-
set(PTHREADPOOL_LIBRARY_TYPE
91-
"static"
92-
CACHE STRING "")
93-
set(PTHREADPOOL_ALLOW_DEPRECATED_API
94-
ON
95-
CACHE BOOL "")
96-
add_subdirectory("${PTHREADPOOL_SOURCE_DIR}")
97-
9859
# ------------------------------ OPTIONS -------------------------------------
9960
# WARNING: Please don't add example specific options in this CMakeLists.txt.
10061
# Instead please use `find_package(executorch REQUIRED)` in the example
@@ -211,6 +172,61 @@ option(EXECUTORCH_BUILD_XNNPACK "Build the XNNPACK backend" OFF)
211172

212173
option(EXECUTORCH_BUILD_VULKAN "Build the Vulkan backend" OFF)
213174

175+
#
176+
# pthreadpool: build pthreadpool library. Disable on unsupported platforms
177+
#
178+
cmake_dependent_option(EXECUTORCH_BUILD_PTHREADPOOL "Build pthreadpool library."
179+
ON "NOT EXECUTORCH_BUILD_ARM_BAREMETAL" OFF)
180+
181+
#
182+
# cpuinfo: build cpuinfo library. Disable on unsupported platforms
183+
#
184+
cmake_dependent_option(EXECUTORCH_BUILD_CPUINFO "Build cpuinfo library." ON
185+
"NOT EXECUTORCH_BUILD_ARM_BAREMETAL" OFF)
186+
187+
if(EXECUTORCH_BUILD_CPUINFO)
188+
# --- cpuinfo
189+
set(CPUINFO_SOURCE_DIR "backends/xnnpack/third-party/cpuinfo")
190+
set(CPUINFO_BUILD_TOOLS
191+
OFF
192+
CACHE BOOL "")
193+
set(CPUINFO_BUILD_UNIT_TESTS
194+
OFF
195+
CACHE BOOL "")
196+
set(CPUINFO_BUILD_MOCK_TESTS
197+
OFF
198+
CACHE BOOL "")
199+
set(CPUINFO_BUILD_BENCHMARKS
200+
OFF
201+
CACHE BOOL "")
202+
set(CPUINFO_LIBRARY_TYPE
203+
"static"
204+
CACHE STRING "")
205+
set(CPUINFO_LOG_LEVEL
206+
"error"
207+
CACHE STRING "")
208+
set(CLOG_SOURCE_DIR "${CPUINFO_SOURCE_DIR}/deps/clog")
209+
add_subdirectory("${CPUINFO_SOURCE_DIR}")
210+
endif()
211+
212+
if(EXECUTORCH_BUILD_PTHREADPOOL)
213+
# --- pthreadpool
214+
set(PTHREADPOOL_SOURCE_DIR "backends/xnnpack/third-party/pthreadpool")
215+
set(PTHREADPOOL_BUILD_TESTS
216+
OFF
217+
CACHE BOOL "")
218+
set(PTHREADPOOL_BUILD_BENCHMARKS
219+
OFF
220+
CACHE BOOL "")
221+
set(PTHREADPOOL_LIBRARY_TYPE
222+
"static"
223+
CACHE STRING "")
224+
set(PTHREADPOOL_ALLOW_DEPRECATED_API
225+
ON
226+
CACHE BOOL "")
227+
add_subdirectory("${PTHREADPOOL_SOURCE_DIR}")
228+
endif()
229+
214230
if(NOT PYTHON_EXECUTABLE)
215231
resolve_python_executable()
216232
endif()

build/Utils.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ function(executorch_print_configuration_summary)
8888
message(
8989
STATUS
9090
" EXECUTORCH_BUILD_VULKAN : ${EXECUTORCH_BUILD_VULKAN}")
91+
message(
92+
STATUS
93+
" EXECUTORCH_BUILD_PTHREADPOOL : ${EXECUTORCH_BUILD_PTHREADPOOL}")
94+
message(
95+
STATUS
96+
" EXECUTORCH_BUILD_CPUINFO : ${EXECUTORCH_BUILD_CPUINFO}")
97+
9198
endfunction()
9299

93100
# This is the funtion to use -Wl, --whole-archive to link static library NB:

examples/arm/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ function build_executorch() {
8585
-DCMAKE_INSTALL_PREFIX=${et_build_dir} \
8686
-DCMAKE_BUILD_TYPE=Release \
8787
-DEXECUTORCH_SELECT_OPS_LIST="aten::_softmax.out" \
88+
-DEXECUTORCH_BUILD_ARM_BAREMETAL=ON \
8889
-DCMAKE_TOOLCHAIN_FILE="${toolchain_cmake}" \
8990
-B"${et_build_dir}"/examples/arm \
9091
"${et_root_dir}"/examples/arm

0 commit comments

Comments
 (0)