From e6f30addfea477ab628cfa71cbd7a4044d515d30 Mon Sep 17 00:00:00 2001 From: James Conroy Date: Thu, 8 Sep 2022 12:04:26 +0100 Subject: Remove aarch32 build from build-tool * Removing support for aarch32 builds from the build-tool as Arm NN is dropping support for this target architecture. * Fixed missing additional ACL scons params in ACL build. Change-Id: Ib18b3286ce18d169ce8d8af2bd9b5d54f110eb3b Signed-off-by: James Conroy --- build-tool/README.md | 22 +++++++++++----------- build-tool/scripts/build-armnn.sh | 24 ++++++++---------------- build-tool/scripts/common.sh | 1 - build-tool/scripts/install-packages.sh | 3 +-- build-tool/scripts/setup-armnn.sh | 18 +----------------- build-tool/scripts/validation.sh | 11 ++--------- 6 files changed, 23 insertions(+), 56 deletions(-) diff --git a/build-tool/README.md b/build-tool/README.md index 30a1a20da7..a5f946756d 100644 --- a/build-tool/README.md +++ b/build-tool/README.md @@ -4,7 +4,7 @@ This tool replaces/supersedes the majority of the existing Arm NN build guides a The main benefit of building Arm NN from scratch is the ability to **exactly choose which components to build, targeted for your ML project**.
The Arm NN Build Tool is tested on **x86_64 (Intel) and aarch64 (Arm) build hosts** for the **Ubuntu** platform. Other host platforms such as Windows and Mac **should** work (with Docker installed), but have not been officially tested.
-At present, the tool supports **targeting Linux devices (from Ubuntu 18.04 onwards) on x86_64, aarch32 and aarch64** architectures.
+At present, the tool supports **targeting Linux devices (from Ubuntu 18.04 onwards) on x86_64 and aarch64** architectures.
We recommend using the Arm NN Build Tool through the use of Docker. However, the scripts may be [executed directly on your machine](#build-arm-nn-without-docker) if desired. **If you already have Docker installed** and want to quickly build the Arm NN Dockerfile with some default build arguments, please follow the [Docker Build Steps](#docker-build-steps). @@ -134,13 +134,13 @@ For ease of use (but longer initial docker build), use ```--all``` to have all A Repeated docker builds with the same ```SETUP_ARGS``` will skip the setup process (using [caching](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache) of previous Docker build steps). The ```SETUP_ARGS``` string should start and end with **double quotes** ```"```. -| SETUP_ARGS | Description | -|-------------------|:-----------------------------------------------------------------------------------| -| --tflite-delegate | **flag:** setup dependencies for the Arm NN TF Lite Delegate | -| --tflite-parser | **flag:** setup dependencies for the Arm NN TF Lite Parser | -| --onnx-parser | **flag:** setup dependencies for the Arm NN ONNX parser | -| --all | **flag:** setup dependencies for all Arm NN components listed above | -| --target-arch= | **mandatory option:** specify a target architecture ```aarch64, aarch32, x86_64``` | +| SETUP_ARGS | Description | +|-------------------|:---------------------------------------------------------------------------------| +| --tflite-delegate | **flag:** setup dependencies for the Arm NN TF Lite Delegate | +| --tflite-parser | **flag:** setup dependencies for the Arm NN TF Lite Parser | +| --onnx-parser | **flag:** setup dependencies for the Arm NN ONNX parser | +| --all | **flag:** setup dependencies for all Arm NN components listed above | +| --target-arch= | **mandatory option:** specify a target architecture ```aarch64, x86_64``` | **At least one component** (e.g. ```--tflite-delegate```) must be provided **or** else provide ```--all``` to setup dependencies for all components. @@ -163,7 +163,7 @@ The ```BUILD_ARGS``` string should start and end with **double quotes** ```"```. | --tflite-parser | **flag:** build the Arm NN TF Lite Parser component | | --onnx-parser | **flag:** build the Arm NN ONNX parser component | | --all | **flag:** build all Arm NN components listed above | -| --target-arch= | **mandatory option:** specify a target architecture ```aarch64, aarch32, x86_64``` | +| --target-arch= | **mandatory option:** specify a target architecture ```aarch64, x86_64``` | | --neon-backend | **flag:** build Arm NN with the NEON backend (CPU acceleration from ACL) | | --cl-backend | **flag:** build Arm NN with the OpenCL backend (GPU acceleration from ACL) | | --ref-backend | **flag:** build Arm NN with the reference backend
**Should be used for verification purposes only.
Does not provide any performance acceleration.** | @@ -183,8 +183,8 @@ Build for aarch64 with all Arm NN components, NEON enabled and OpenCL enabled: ```BUILD_ARGS="--target-arch=aarch64 --tflite-delegate --cl-backend --acl-scons-params='compress_kernels=1 benchmark_examples=1'"``` -Setup for aarch32 with all Arm NN dependencies, OpenCL enabled and additional Arm NN cmake args:
-```BUILD_ARGS="--target-arch=aarch32 --all --cl-backend --armnn-cmake-args='-DBUILD_SAMPLE_APP=1 -DBUILD_UNIT_TESTS=0'"``` +Setup for aarch64 with all Arm NN dependencies, OpenCL enabled and additional Arm NN cmake args:
+```BUILD_ARGS="--target-arch=aarch64 --all --cl-backend --armnn-cmake-args='-DBUILD_SAMPLE_APP=1 -DBUILD_UNIT_TESTS=0'"``` **Example _valid_ combination of SETUP_ARGS and BUILD_ARGS:**
``` diff --git a/build-tool/scripts/build-armnn.sh b/build-tool/scripts/build-armnn.sh index 98b3b3f6fc..10f41e8cc7 100755 --- a/build-tool/scripts/build-armnn.sh +++ b/build-tool/scripts/build-armnn.sh @@ -17,7 +17,8 @@ build_acl() { cd "$ACL_SRC" - local acl_params="neon=$flag_neon_backend opencl=$flag_cl_backend Werror=0 embed_kernels=1 examples=0 validation_tests=0 benchmark_tests=0 benchmark_examples=0" + # $acl_scons_params are additional options provided by the user and will overwrite any previously defined args + local acl_params="neon=$flag_neon_backend opencl=$flag_cl_backend Werror=0 embed_kernels=1 examples=0 validation_tests=0 benchmark_tests=0 benchmark_examples=0 $acl_scons_params" if [ "$flag_debug" -eq 1 ]; then acl_params="$acl_params debug=1 asserts=1" @@ -40,11 +41,6 @@ build_acl() acl_arch="arch=arm64-v8a" ;; - "aarch32") - compile_flags+="$AARCH32_COMPILER_FLAGS" - acl_arch="arch=armv7a" - ;; - "x86_64") acl_arch="arch=x86_64" ;; @@ -88,10 +84,6 @@ build_armnn() "aarch64") compile_flags+="$AARCH64_COMPILER_FLAGS" ;; - - "aarch32") - compile_flags+="$AARCH32_COMPILER_FLAGS" - ;; esac if [ "$flag_clean" -eq 1 ]; then @@ -199,7 +191,7 @@ build-armnn.sh [OPTION]... build the Arm NN ONNX parser component --all build all Arm NN components listed above - --target-arch=[aarch64|aarch32|x86_64] + --target-arch=[aarch64|x86_64] specify a target architecture (mandatory) --neon-backend build Arm NN with the NEON backend (CPU acceleration from ACL) @@ -212,9 +204,9 @@ build-armnn.sh [OPTION]... --debug build Arm NN (and ACL) with debug turned on (optional: defaults to off) --armnn-cmake-args= - provide additional space-separated CMake arguments for building Arm NN (optional) + provide additional space-separated CMake arguments string for building Arm NN (optional) --acl-scons-params= - provide additional space-separated scons parameters for building ACL (optional) + provide additional space-separated scons parameters string for building ACL (optional) --num-threads= specify number of threads/cores to build dependencies with (optional: defaults to number of online CPU cores on host) -h, --help @@ -236,9 +228,9 @@ Examples: Build for aarch64 with all Arm NN components, NEON enabled and OpenCL enabled: /build-armnn.sh --target-arch=aarch64 --all --neon-backend --cl-backend Build for aarch64 with TF Lite Delegate, OpenCL enabled and additional ACL scons params: - /build-armnn.sh --target-arch=aarch64 --tflite-delegate --cl-backend --acl-scons-params="compress_kernels=1 benchmark_examples=1" -Setup for aarch32 with all Arm NN dependencies, OpenCL enabled and additional Arm NN cmake args: - /build-armnn.sh --target-arch=aarch32 --all --cl-backend --armnn-cmake-args="-DBUILD_SAMPLE_APP=1 -DBUILD_UNIT_TESTS=0" + /build-armnn.sh --target-arch=aarch64 --tflite-delegate --cl-backend --acl-scons-params='compress_kernels=1 benchmark_examples=1' +Setup for aarch64 with all Arm NN dependencies, OpenCL enabled and additional Arm NN cmake args: + /build-armnn.sh --target-arch=aarch64 --all --cl-backend --armnn-cmake-args='-DBUILD_SAMPLE_APP=1 -DBUILD_UNIT_TESTS=0' EOF } diff --git a/build-tool/scripts/common.sh b/build-tool/scripts/common.sh index f9f8f974aa..63512182ee 100755 --- a/build-tool/scripts/common.sh +++ b/build-tool/scripts/common.sh @@ -37,7 +37,6 @@ if [ "$TARGET_ARCH" == "$HOST_ARCH" ]; then fi AARCH64_COMPILER_FLAGS+="CC=/usr/bin/aarch64-linux-gnu-gcc CXX=/usr/bin/aarch64-linux-gnu-g++ " -AARCH32_COMPILER_FLAGS+="CC=/usr/bin/arm-linux-gnueabihf-gcc CXX=/usr/bin/arm-linux-gnueabihf-g++ " # Flatbuffers FLATBUFFERS_VERSION=1.12.0 diff --git a/build-tool/scripts/install-packages.sh b/build-tool/scripts/install-packages.sh index 4f62fece2c..64a3405e74 100755 --- a/build-tool/scripts/install-packages.sh +++ b/build-tool/scripts/install-packages.sh @@ -82,8 +82,7 @@ install_apt_packages() # Install cross compile toolchains if host is x86_64 if [ "$HOST_ARCH" == "x86_64" ]; then apt-get update && apt-get install -y --no-install-recommends \ - crossbuild-essential-arm64 \ - crossbuild-essential-armhf + crossbuild-essential-arm64 fi apt-get clean diff --git a/build-tool/scripts/setup-armnn.sh b/build-tool/scripts/setup-armnn.sh index d6f6fce9db..b016b53bd0 100755 --- a/build-tool/scripts/setup-armnn.sh +++ b/build-tool/scripts/setup-armnn.sh @@ -56,9 +56,6 @@ build_protobuf() if [ "$TARGET_ARCH" == "aarch64" ]; then cmake_flags+="$AARCH64_COMPILER_FLAGS" additional_cmds+="--host=aarch64-linux " - elif [ "$TARGET_ARCH" == "aarch32" ]; then - cmake_flags+="$AARCH32_COMPILER_FLAGS" - additional_cmds+="--host=arm-linux " fi else target_arch="$HOST_ARCH" @@ -100,8 +97,6 @@ build_flatbuffers() mkdir -p "$FLATBUFFERS_BUILD_TARGET" if [ "$TARGET_ARCH" == "aarch64" ]; then cmake_flags+="$AARCH64_COMPILER_FLAGS" - elif [ "$TARGET_ARCH" == "aarch32" ]; then - cmake_flags+="$AARCH32_COMPILER_FLAGS" fi else target_arch="$HOST_ARCH" @@ -156,15 +151,6 @@ build_tflite() cmake_flags+="ARMCC_FLAGS='-funsafe-math-optimizations' " fi ;; - - "aarch32") - cmake_flags+="$AARCH32_COMPILER_FLAGS" - target_arch_cmd="-DCMAKE_SYSTEM_PROCESSOR=armv7 " - - if [ "$NATIVE_BUILD" -eq 0 ]; then - cmake_flags+="ARMCC_FLAGS='-march=armv7-a -mfpu=neon-vfpv4 -funsafe-math-optimizations -mfp16-format=ieee' " - fi - ;; esac echo -e "\n***** Building TF Lite for $TARGET_ARCH *****" @@ -233,7 +219,7 @@ setup-armnn.sh [OPTION]... setup dependencies for the Arm NN ONNX parser --all setup dependencies for all Arm NN components listed above - --target-arch=[aarch64|aarch32|x86_64] + --target-arch=[aarch64|x86_64] specify a target architecture (mandatory) --num-threads= specify number of threads/cores to build dependencies with (optional: defaults to number of online CPU cores on host) @@ -251,8 +237,6 @@ Setup for aarch64 with all Arm NN dependencies: /setup-armnn.sh --target-arch=aarch64 --all Setup for aarch64 with TF Lite Delegate and TF Lite Parser dependencies only: /setup-armnn.sh --target-arch=aarch64 --tflite-delegate --tflite-parser -Setup for aarch32 with all Arm NN dependencies: - /setup-armnn.sh --target-arch=aarch32 --all EOF } diff --git a/build-tool/scripts/validation.sh b/build-tool/scripts/validation.sh index 785c1b8f83..7928952577 100755 --- a/build-tool/scripts/validation.sh +++ b/build-tool/scripts/validation.sh @@ -20,8 +20,8 @@ if [ "$target_arch" == "" ]; then exit 1 fi -if [ "$target_arch" != "aarch64" ] && [ "$target_arch" != "aarch32" ] && [ "$target_arch" != "x86_64" ]; then - echo "$name: --target-arch is not valid. Valid options are: aarch64, aarch32, x86_64" +if [ "$target_arch" != "aarch64" ] && [ "$target_arch" != "x86_64" ]; then + echo "$name: --target-arch is not valid. Valid options are: aarch64, x86_64" exit 1 fi @@ -32,13 +32,6 @@ if [ "$HOST_ARCH" == "aarch64" ]; then fi fi -if [ "$target_arch" == "aarch32" ]; then - if [ "$HOST_ARCH" != "x86_64" ]; then - echo "$name: aarch32 is the only supported --target_arch when host is x86_64 (cross compile only)" - exit 1 - fi -fi - # Validation of chosen Arm NN dependencies if [ "$flag_tflite_delegate" -eq 0 ] && [ "$flag_tflite_parser" -eq 0 ] && [ "$flag_onnx_parser" -eq 0 ]; then echo "$name: at least one of flags --tflite-delegate, --tflite-parser or --onnx-parser must be set (or --all)." -- cgit v1.2.1