-
Notifications
You must be signed in to change notification settings - Fork 595
Initial framework of an ethos-u runtime backend #3 #659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
225c115
Initial Ethos-U runtime backend
robell a7aa848
Fixed error messages on runtime init
robell f95fead
lintrunner cleanup
robell 524afc6
Add ArmBackend to example scripts
robell 2bfdb5f
Add delegate test and FVP output
robell 8267612
Fix delegate runner patch
robell 6b398fe
cmake compiler and log behaviour fixing
robell 6ca9b26
Minimal example of AoT with ArmPartitioner+Vela
robell f40ab5f
Generate pte for delegate test on the fly
robell d10d620
Added support for variable input output patterns
robell b812898
Handle multiple delegate inputs with SRAM offsets
robell 44a46a1
Add TOSA ref model and Vela dependencies
robell cb16e68
Cleanup from lintrunner and other bits of tidyup
robell 8aa80d0
Removed ethos u driver build and cmsis dependency
robell 3a5fd4f
renamed lib ethos_u to executorch_delegate_ethos_u
robell e676620
lintfix
robell 4b1125e
tidied delegate_runner output
robell 7afc5e4
Fixed some merge issues
robell e340b5c
Test fixes for compiler output choice
robell 6b7a18a
review fixes
robell c453e43
review feedback/improvements
robell 1917b54
tidy up example scripts
robell 20bf2eb
further review comments
robell 468d6fc
revised path for ethosu_minimal
robell 709a688
lintfix
robell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2023 Arm Limited and/or its affiliates. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
cmake_minimum_required(VERSION 3.19) | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
# Source root directory for executorch. | ||
if(NOT EXECUTORCH_ROOT) | ||
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) | ||
endif() | ||
|
||
include(${EXECUTORCH_ROOT}/build/Utils.cmake) | ||
|
||
set(_common_include_directories ${EXECUTORCH_ROOT}/..) | ||
|
||
include(cmake/Dependencies.cmake) | ||
|
||
set(_arm_baremetal_sources backends/arm/runtime/ArmBackendEthosU.cpp) | ||
list(TRANSFORM _arm_baremetal_sources PREPEND "${EXECUTORCH_ROOT}/") | ||
|
||
add_library( | ||
executorch_delegate_ethos_u | ||
digantdesai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
STATIC ${_arm_baremetal_sources} | ||
) | ||
target_include_directories( | ||
executorch_delegate_ethos_u | ||
PUBLIC | ||
${_common_include_directories} | ||
) | ||
target_include_directories( | ||
executorch_delegate_ethos_u | ||
PUBLIC | ||
${DRIVER_ETHOSU_INCLUDE_DIR} | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2023 Arm Limited and/or its affiliates. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set(THIRD_PARTY_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/third-party") | ||
|
||
# Ethos-U driver | ||
set(DRIVER_ETHOSU_INCLUDE_DIR "${THIRD_PARTY_ROOT}/ethos-u-core-driver/include") | ||
include_directories( ${DRIVER_ETHOSU_INCLUDE_DIR} ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
# Copyright 2023 Arm Limited and/or its affiliates. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
set -e | ||
|
||
# | ||
# Setup toolchain | ||
# | ||
BASEDIR=`realpath $(dirname "$0")` | ||
echo "building using build.sh in $BASEDIR" | ||
|
||
ARCH=$(uname -i) | ||
GCCPATH=${BASEDIR}/arm-gnu-toolchain-12.3.rel1-${ARCH}-arm-none-eabi/bin/ | ||
|
||
echo $GCCPATH | ||
if test -d "${GCCPATH}"; then | ||
echo Using exising compiler ${GCCPATH} | ||
else | ||
pushd ${BASEDIR}/ | ||
./toolchain.sh | ||
popd | ||
fi | ||
export PATH=${PATH}:${GCCPATH} | ||
|
||
echo building with `arm-none-eabi-gcc -v 2>&1 | grep "^gcc"` | ||
|
||
|
||
# | ||
# Prepare and run clean build | ||
# | ||
rm -rf buck-out/ build/lib/ cmake-out/ | ||
rm -rf cmake-corstone | ||
mkdir cmake-corstone | ||
cd cmake-corstone | ||
|
||
#cmake -DBUCK2=buck2 .. | ||
|
||
#cmake --toolchain backends/arm/cmake/arm-none-eabi-gcc.cmake .. | ||
cmake -DFLATC_EXECUTABLE=flatc \ | ||
-DEXECUTORCH_BUILD_XNNPACK=OFF \ | ||
-DEXECUTORCH_BUILD_HOST_TARGETS=OFF \ | ||
-DEXECUTORCH_BUILD_ARM_BAREMETAL=ON \ | ||
-DCMAKE_SYSTEM_PROCESSOR=cortex-m55+nodsp+nofp \ | ||
-DETHOSU_TARGET_NPU_CONFIG=ethos-u55-128 \ | ||
--toolchain backends/arm/cmake/arm-none-eabi-gcc.cmake \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DEXECUTORCH_ENABLE_LOGGING_RELEASE_MODE=ON \ | ||
.. | ||
|
||
cd .. | ||
cmake --build cmake-corstone -j9 --target ethos_u ethosu_core_driver executorch portable_ops_lib portable_kernels |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# Copyright 2023 Arm Limited and/or its affiliates. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
set -e | ||
|
||
# Cross compiler for Arm baremetal (e.g. Corestone-300 FVP or silcon) | ||
ARCH=$(uname -i) | ||
curl -o gcc.tar.xz https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-${ARCH}-arm-none-eabi.tar.xz | ||
tar xf gcc.tar.xz | ||
export PATH=${PATH}:`(cd arm-gnu-toolchain-12.3.rel1-aarch64-arm-none-eabi/bin/; pwd)` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.