Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 31 additions & 28 deletions examples/arm/executor_runner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ option(ET_ARM_BAREMETAL_TEMP_ALLOCATOR_POOL_SIZE "Set ET_ARM_BAREMETAL_TEMP_ALLO
option(ET_BUNDLE_IO "Set to compile in BundleIO support" OFF)
option(ET_ATOL "Set atol to use for BundleIO testing" OFF)
option(ET_RTOL "Set rtol to use for BundleIO testing" OFF)
option(FETCH_ETHOS_U_CONTENT "Fetch ethos_u dependencies instead of relying on pre-downloads" ON)

if(NOT DEFINED ET_PTE_FILE_PATH AND NOT ${SEMIHOSTING})
message(
Expand Down Expand Up @@ -47,39 +48,41 @@ set(PYTHON_EXECUTABLE
CACHE PATH "Define to override python executable used"
)

# Download ethos_u dependency if needed.
file(MAKE_DIRECTORY ${ETHOS_SDK_PATH}/../ethos_u)

include(FetchContent)
set(ethos_u_base_rev "25.02")
FetchContent_Declare(
ethos_u
GIT_REPOSITORY https://git.gitlab.arm.com/artificial-intelligence/ethos-u/ethos-u.git
GIT_TAG ${ethos_u_base_rev}
SOURCE_DIR ${ETHOS_SDK_PATH}
BINARY_DIR ${ETHOS_SDK_PATH}
SUBBUILD_DIR ${ETHOS_SDK_PATH}/../ethos_u-subbuild
SOURCE_SUBDIR none
if(FETCH_ETHOS_U_CONTENT)
# Download ethos_u dependency if needed.
file(MAKE_DIRECTORY ${ETHOS_SDK_PATH}/../ethos_u)

include(FetchContent)
set(ethos_u_base_rev "25.02")
FetchContent_Declare(
ethos_u
GIT_REPOSITORY https://git.gitlab.arm.com/artificial-intelligence/ethos-u/ethos-u.git
GIT_TAG ${ethos_u_base_rev}
SOURCE_DIR ${ETHOS_SDK_PATH}
BINARY_DIR ${ETHOS_SDK_PATH}
SUBBUILD_DIR ${ETHOS_SDK_PATH}/../ethos_u-subbuild
SOURCE_SUBDIR none
)

FetchContent_MakeAvailable(ethos_u)
FetchContent_MakeAvailable(ethos_u)

# Get ethos_u externals only if core_platform folder does not already exist.
if(NOT EXISTS "${ETHOS_SDK_PATH}/core_platform")
execute_process(COMMAND ${PYTHON_EXECUTABLE} fetch_externals.py -c ${ethos_u_base_rev}.json fetch
WORKING_DIRECTORY ${ETHOS_SDK_PATH}
COMMAND_ECHO STDOUT
# Get ethos_u externals only if core_platform folder does not already exist.
if(NOT EXISTS "${ETHOS_SDK_PATH}/core_platform")
execute_process(COMMAND ${PYTHON_EXECUTABLE} fetch_externals.py -c ${ethos_u_base_rev}.json fetch
WORKING_DIRECTORY ${ETHOS_SDK_PATH}
COMMAND_ECHO STDOUT
)
endif()

# Always patch the core_platform repo since this is fast enough.
set(core_platform_base_rev "b728c774158248ba2cad8e78a515809e1eb9b77f")
set(patch_dir "${ET_DIR_PATH}/examples/arm/ethos-u-setup")
execute_process(COMMAND bash -c "pwd && source backends/arm/scripts/utils.sh && patch_repo ${ETHOS_SDK_PATH}/core_platform ${core_platform_base_rev} ${patch_dir}"
WORKING_DIRECTORY ${ET_DIR_PATH}
COMMAND_ECHO STDOUT
)
endif()

# Always patch the core_platform repo since this is fast enough.
set(core_platform_base_rev "b728c774158248ba2cad8e78a515809e1eb9b77f")
set(patch_dir "${ET_DIR_PATH}/examples/arm/ethos-u-setup")
execute_process(COMMAND bash -c "pwd && source backends/arm/scripts/utils.sh && patch_repo ${ETHOS_SDK_PATH}/core_platform ${core_platform_base_rev} ${patch_dir}"
WORKING_DIRECTORY ${ET_DIR_PATH}
COMMAND_ECHO STDOUT
)

# Selects timing adapter values matching system_config.
# Default is Ethos_U55_High_End_Embedded, simulating optimal hardware for the Corestone-300.
set(SYSTEM_CONFIG "Ethos_U55_High_End_Embedded" CACHE STRING "System config")
Expand Down Expand Up @@ -592,4 +595,4 @@ if(SEMIHOSTING)
${ETHOS_SDK_PATH}/core_platform/targets/${TARGET_BOARD}/retarget.c
PROPERTIES HEADER_FILE_ONLY TRUE
)
endif()
endif()
2 changes: 1 addition & 1 deletion examples/arm/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function help() {
echo "Options:"
echo " --model_name=<MODEL> Model file .py/.pth/.pt, builtin model or a model from examples/models. Passed to aot_arm_compiler"
echo " --model_input=<INPUT> Provide model input .pt file to override the input in the model file. Passed to aot_arm_compiler"
echo " NOTE: Inference in FVP is done with a dummy input full of ones. Use bundleio flag to run the model in FVP with the custom input or the input from the model file."
echo " NOTE: Inference in FVP is done with a dummy input full of ones. Use bundleio flag to run the model in FVP with the custom input or the input from the model file."
echo " --aot_arm_compiler_flags=<FLAGS> Only used if --model_name is used Default: ${aot_arm_compiler_flags}"
echo " --portable_kernels=<OPS> Comma separated list of portable (non delagated) kernels to include Default: ${portable_kernels}"
echo " --target=<TARGET> Target to build and run for Default: ${target}"
Expand Down
Loading