aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2021-12-20 13:27:04 +0000
committerJim Flynn <jim.flynn@arm.com>2021-12-21 09:51:46 +0000
commit2ca9a14b04f31f6a029b2747d39ee49a682eddab (patch)
tree24d45b02c6ed0a82f265749b4f5d5a7317b5fbfb
parentbc2e217d90064820e272a5d178c35657a659a864 (diff)
downloadarmnn-2ca9a14b04f31f6a029b2747d39ee49a682eddab.tar.gz
IVGCVSW-6668 Updating build guides
* Updated build guides to refer to get_compute_library.sh and get_tensorflow.sh * Corrected TensorFlow Version in guides was v2.5.1 but release notes say v2.5.0 * Reordered command sequence to ensure that Arm NN is downloaded and ready before downloading TensorFlow or Arm Compute Library * Fixed hyperlinks in MD files * Added whitespace to fix MD formatting. Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: Iabc309cbbd41d969eb1e11e9dd33a0b1da39a27b
-rw-r--r--BuildGuideAndroidNDK.md83
-rw-r--r--BuildGuideCrossCompilation.md63
-rw-r--r--delegate/BuildGuideNative.md43
-rw-r--r--delegate/DelegateQuickStartGuide.md4
4 files changed, 111 insertions, 82 deletions
diff --git a/BuildGuideAndroidNDK.md b/BuildGuideAndroidNDK.md
index 3408ec1326..9936bf2df1 100644
--- a/BuildGuideAndroidNDK.md
+++ b/BuildGuideAndroidNDK.md
@@ -2,9 +2,10 @@
- [Introduction](#introduction)
- [Download the Android NDK and make a standalone toolchain](#download-the-android-ndk-and-make-a-standalone-toolchain)
-- [Build the Compute Library](#build-the-compute-library)
- [Build Google's Protobuf library](#build-google-s-protobuf-library)
-- [Build Arm NN](#build-armnn)
+- [Download Arm NN](#download-arm-nn)
+- [Build Arm Compute Library](#build-arm-compute-library)
+- [Build Arm NN](#build-arm-nn)
- [Build Standalone Sample Dynamic Backend](#build-standalone-sample-dynamic-backend)
- [Run the Arm NN unit tests on an Android device](#run-the-armnn-unit-tests-on-an-android-device)
@@ -34,36 +35,10 @@ All downloaded or generated files will be saved inside the `$HOME/armnn-devenv`
* With the android ndk-20b, you don't need to use the make_standalone_toolchain script to create a toolchain for a specific version of android. Android's current preference is for you to just specify the architecture and operating system while setting the compiler and just use the ndk directory.
-## Build the Compute Library
-* Clone the Compute Library:
-
- (Requires Git if not previously installed: `sudo apt install git`)
-``` bash
-cd $HOME/armnn-devenv
-git clone https://github.com/ARM-software/ComputeLibrary.git
-```
-
-* Checkout ComputeLibrary release tag:
-```bash
-cd ComputeLibrary
-git checkout <tag_name>
-```
-For example, if you want to checkout release tag of 21.02:
-```bash
-git checkout v21.02
-```
-
-* Build:
-
- (Requires SCons if not previously installed: `sudo apt install scons`)
-```bash
-scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" \
- benchmark_tests=0 validation_tests=0 os=android -j16
-```
-
## Build Google's Protobuf library (Optional)
-* Clone protobuf:
+* Clone protobuf:
+ (Requires Git if not previously installed: `sudo apt install git`)
```bash
mkdir $HOME/armnn-devenv/google
cd $HOME/armnn-devenv/google
@@ -72,9 +47,8 @@ cd protobuf
git checkout -b v3.12.0 v3.12.0
```
-* Build a native (x86) version of the protobuf libraries and compiler (protoc):
-
- (Requires cUrl, autoconf, llibtool, and other build dependencies if not previously installed: `sudo apt install curl autoconf libtool build-essential g++`)
+* Build a native (x86) version of the protobuf libraries and compiler (protoc):
+ (Requires cUrl, autoconf, llibtool, and other build dependencies if not previously installed: `sudo apt install curl autoconf libtool build-essential g++`)
```bash
./autogen.sh
mkdir x86_build
@@ -102,11 +76,12 @@ cd ..
Note: The ANDROID_API variable should be set to the Android API version number you are using. E.g. "30" for Android R.
-## Build Arm NN
+## Download Arm NN
+* Clone Arm NN:
+ (Requires Git if not previously installed: `sudo apt install git`)
-* Clone Arm NN source code:
```bash
-cd $HOME/armnn-devenv/
+cd $HOME/armnn-devenv
git clone https://github.com/ARM-software/armnn.git
```
@@ -117,15 +92,43 @@ git checkout <branch_name>
git pull
```
-For example, if you want to checkout release branch of 21.02:
+For example, if you want to check out the 21.11 release branch:
```bash
-git checkout branches/armnn_21_02
+git checkout branches/armnn_21_11
git pull
```
-* Build Arm NN:
+## Build Arm Compute Library
+* Clone Arm Compute Library:
+
+```bash
+cd $HOME/armnn-devenv
+git clone https://github.com/ARM-software/ComputeLibrary.git
+```
+* Checkout Arm Compute Library release tag:
+```bash
+cd ComputeLibrary
+git checkout <tag_name>
+```
+Arm NN and Arm Compute Library are developed closely together. If you would like to use the Arm NN 21.11 release you will need the 21.11 release of ACL too. For example, if you want to checkout the 21.11 release tag:
+```bash
+git checkout v21.11
+```
+Arm NN provides a script that downloads the version of Arm Compute Library that Arm NN was tested with:
+```bash
+git checkout $(../armnn/scripts/get_compute_library.sh -p)
+```
+* the Arm Compute Library:
+ (Requires SCons if not previously installed: `sudo apt install scons`)
+```bash
+scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" \
+ benchmark_tests=0 validation_tests=0 os=android -j16
+```
+
+## Build Arm NN
- (Requires CMake if not previously installed: `sudo apt install cmake`)
+* Build Arm NN:
+ (Requires CMake if not previously installed: `sudo apt install cmake`)
```bash
mkdir $HOME/armnn-devenv/armnn/build
cd $HOME/armnn-devenv/armnn/build
diff --git a/BuildGuideCrossCompilation.md b/BuildGuideCrossCompilation.md
index d70f1ca4f1..53a9d719bf 100644
--- a/BuildGuideCrossCompilation.md
+++ b/BuildGuideCrossCompilation.md
@@ -3,8 +3,8 @@
- [Introduction](#introduction)
- [Cross-compiling ToolChain](#cross-compiling-toolchain)
- [Build and install Google's Protobuf library](#build-and-install-google-s-protobuf-library)
-- [Build Compute Library](#build-compute-library)
-- [Download ArmNN](#download-armnn)
+- [Download Arm NN](#download-arm-nn)
+- [Build Arm Compute Library](#build-arm-compute-library)
- [Build Flatbuffer](#build-flatbuffer)
- [Build Onnx](#build-onnx)
- [Build TfLite](#build-tflite)
@@ -23,7 +23,6 @@ mkdir $HOME/armnn-devenv
cd $HOME/armnn-devenv
'''
-
## Cross-compiling ToolChain
* Install the standard cross-compilation libraries for arm64:
```
@@ -33,7 +32,8 @@ sudo apt install crossbuild-essential-arm64
## Build and install Google's Protobuf library
We support protobuf version 3.12.0
-* Get protobuf from here: https://github.com/protocolbuffers/protobuf :
+* Get protobuf from here: https://github.com/protocolbuffers/protobuf:
+ (Requires Git if not previously installed: `sudo apt install git`)
```bash
git clone -b v3.12.0 https://github.com/google/protobuf.git protobuf
cd protobuf
@@ -62,40 +62,54 @@ make install -j16
cd ..
```
-
-## Build Compute Library
-* Building the Arm Compute Library:
+## Download Arm NN
+* Clone Arm NN:
```bash
cd $HOME/armnn-devenv
-git clone https://github.com/ARM-software/ComputeLibrary.git
-cd ComputeLibrary/
-git checkout <tag_name>
-scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" -j4 internal_only=0
+git clone https://github.com/ARM-software/armnn.git
```
-For example, if you want to checkout release tag of 21.02:
+* Checkout Arm NN branch:
+```bash
+cd armnn
+git checkout <branch_name>
+git pull
+```
+For example, if you want to check out the 21.11 release branch:
```bash
-git checkout v21.02
+git checkout branches/armnn_21_11
+git pull
```
-## Download ArmNN
+## Build Arm Compute Library
+* Clone Arm Compute Library:
```bash
cd $HOME/armnn-devenv
-git clone https://github.com/ARM-software/armnn.git
-cd armnn
-git checkout <branch_name>
-git pull
+git clone https://github.com/ARM-software/ComputeLibrary.git
```
-
-For example, if you want to checkout release branch of 21.02:
+* Checkout Arm Compute Library release tag:
```bash
-git checkout branches/armnn_21_02
-git pull
+cd ComputeLibrary
+git checkout <tag_name>
+```
+Arm NN and Arm Compute Library are developed closely together. If you would like to use the Arm NN 21.11 release you will need the 21.11 release of ACL too. For example, if you want to checkout the 21.11 release tag:
+```bash
+git checkout v21.11
+```
+Arm NN provides a script that downloads the version of Arm Compute Library that Arm NN was tested with:
+```bash
+git checkout $(../armnn/scripts/get_compute_library.sh -p)
+```
+* Build the Arm Compute Library:
+ (Requires SCons if not previously installed: `sudo apt install scons`)
+```bash
+scons arch=arm64-v8a neon=1 opencl=1 embed_kernels=1 extra_cxx_flags="-fPIC" -j4 internal_only=0
```
## Build Flatbuffer
* Building Flatbuffer version 1.12.0
+ (Requires CMake if not previously installed: `sudo apt install cmake`)
```bash
cd $HOME/armnn-devenv
wget -O flatbuffers-1.12.0.tar.gz https://github.com/google/flatbuffers/archive/v1.12.0.tar.gz
@@ -137,13 +151,12 @@ onnx/onnx.proto --proto_path=. --proto_path=../google/x86_64_pb_install/include
```
## Build TfLite
-* Building TfLite (Tensorflow version 2.5.1)
+* Arm NN provides a script, armnn/scripts/get_tensorflow.sh, that can be used to check out the version of TensorFlow that Arm NN was tested with:
```bash
cd $HOME/armnn-devenv
git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow/
-git checkout tags/v2.5.1
-cd ..
+git checkout $(../armnn/scripts/get_tensorflow.sh -p) # Checks out the latest tested version of TF
mkdir tflite
cd tflite
cp ../tensorflow/tensorflow/lite/schema/schema.fbs .
diff --git a/delegate/BuildGuideNative.md b/delegate/BuildGuideNative.md
index 62d6673925..932c74423a 100644
--- a/delegate/BuildGuideNative.md
+++ b/delegate/BuildGuideNative.md
@@ -11,6 +11,7 @@ natively (no cross-compilation required). This is to keep this guide simple.
**Table of content:**
- [Delegate build guide introduction](#delegate-build-guide-introduction)
- [Dependencies](#dependencies)
+ * [Download Arm NN](#download-arm-nn)
* [Build Tensorflow Lite for C++](#build-tensorflow-lite-for-c--)
* [Build Flatbuffers](#build-flatbuffers)
* [Build the Arm Compute Library](#build-the-arm-compute-library)
@@ -23,7 +24,7 @@ natively (no cross-compilation required). This is to keep this guide simple.
# Dependencies
Build Dependencies:
- * Tensorflow Lite: this guide uses version 2.5.1 . Other versions may work.
+ * Tensorflow Lite: this guide uses version 2.5.0. Other versions may work.
* Flatbuffers 1.12.0
* Arm NN 21.11 or higher
@@ -45,6 +46,18 @@ mkdir $BASEDIR
cd $BASEDIR
apt-get update && apt-get install git wget unzip zip python git cmake scons
```
+
+## Download Arm NN
+
+First clone Arm NN using Git.
+
+```bash
+cd $BASEDIR
+git clone "https://review.mlplatform.org/ml/armnn"
+cd armnn
+git checkout <branch_name> # e.g. branches/armnn_21_11
+```
+
## Build Tensorflow Lite for C++
Tensorflow has a few dependencies on it's own. It requires the python packages pip3, numpy,
and also Bazel or CMake which are used to compile Tensorflow. A description on how to build bazel can be
@@ -65,13 +78,14 @@ sudo make install
```
### Download and build Tensorflow Lite
-
+Arm NN provides a script, armnn/scripts/get_tensorflow.sh, that can be used to download the version of TensorFlow that Arm NN was tested with:
```bash
cd $BASEDIR
git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow/
-git checkout tags/v2.5.1 # Minimum version required for the delegate is v2.3.1
+git checkout $(../armnn/scripts/get_tensorflow.sh -p) # Minimum version required for the delegate is v2.3.1
```
+
Now the build process can be started. When calling "cmake", as below, you can specify a number of build
flags. But if you have no need to configure your tensorflow build, you can follow the exact commands below:
```bash
@@ -100,17 +114,19 @@ The Arm NN library depends on the Arm Compute Library (ACL). It provides a set o
both Arm CPUs and GPUs. The Arm Compute Library is used directly by Arm NN to run machine learning workloads on
Arm CPUs and GPUs.
-It is important to have the right version of ACL and Arm NN to make it work. Luckily, Arm NN and ACL are developed
-very closely and released together. If you would like to use the Arm NN version "20.11" you should use the same "20.11"
-version for ACL too.
+It is important to have the right version of ACL and Arm NN to make it work. Arm NN and ACL are developed very closely
+and released together. If you would like to use the Arm NN version "21.11" you should use the same "21.11" version for
+ACL too. Arm NN provides a script, armnn/scripts/get_compute_library.sh, that can be used to download the exact version
+of Arm Compute Library that Arm NN was tested with.
+
+To build the Arm Compute Library on your platform, download the Arm Compute Library and checkout the tag that contains
+the version you want to use. Build it using `scons`.
-To build the Arm Compute Library on your platform, download the Arm Compute Library and checkout the tag
-that contains the version you want to use. Build it using `scons`.
```bash
-cd $BASEDIR
+cd $HOME/armnn-devenv
git clone https://review.mlplatform.org/ml/ComputeLibrary
cd ComputeLibrary/
-git checkout <tag_name> # e.g. v20.11
+git checkout $(../armnn/scripts/get_compute_library.sh -p) # e.g. v21.11
# The machine used for this guide only has a Neon CPU which is why I only have "neon=1" but if
# your machine has an arm Gpu you can enable that by adding `opencl=1 embed_kernels=1 to the command below
scons arch=arm64-v8a neon=1 extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0
@@ -118,13 +134,10 @@ scons arch=arm64-v8a neon=1 extra_cxx_flags="-fPIC" benchmark_tests=0 validation
## Build the Arm NN Library
-With ACL built we can now continue to building Arm NN. To do so, download the repository and checkout the matching
-version as you did for ACL. Create a build directory and use `cmake` to build it.
+With ACL built we can now continue to build Arm NN. Create a build directory and use `cmake` to build it.
```bash
cd $BASEDIR
-git clone "https://review.mlplatform.org/ml/armnn"
cd armnn
-git checkout <branch_name> # e.g. branches/armnn_20_11
mkdir build && cd build
# if you've got an arm Gpu add `-DARMCOMPUTECL=1` to the command below
cmake .. -DARMCOMPUTE_ROOT=$BASEDIR/ComputeLibrary -DARMCOMPUTENEON=1 -DBUILD_UNIT_TESTS=0
@@ -172,7 +185,7 @@ Download Arm NN if you have not already done so:
cd $BASEDIR
git clone "https://review.mlplatform.org/ml/armnn"
cd armnn
-git checkout <branch_name> # e.g. branches/armnn_20_11
+git checkout <branch_name> # e.g. branches/armnn_21_11
```
Build Arm NN with the delegate included
```bash
diff --git a/delegate/DelegateQuickStartGuide.md b/delegate/DelegateQuickStartGuide.md
index ed462b2a1b..b581bce62c 100644
--- a/delegate/DelegateQuickStartGuide.md
+++ b/delegate/DelegateQuickStartGuide.md
@@ -47,7 +47,7 @@ you can download the binaries [here](https://github.com/ARM-software/armnn/relea
We recommend creating a virtual environment for this tutorial. For the following code to work python3 is needed. Please
also check the documentation of the TfLite version you want to use. There might be additional prerequisites for the python
-version. We will use Tensorflow Lite 2.5.1 for this guide.
+version. We will use Tensorflow Lite 2.5.0 for this guide.
```bash
# Install python3 (We ended up with python3.5.3) and virtualenv
sudo apt-get install python3-pip
@@ -71,7 +71,7 @@ mobile and embedded devices.
The TfLite [website](https://www.tensorflow.org/lite/guide/python) shows you two methods to download the `tflite_runtime` package.
In our experience, the use of the pip command works for most systems including debian. However, if you're using an older version of Tensorflow,
you may need to build the pip package from source. You can find more information [here](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/tools/pip_package/README.md).
-But in our case, with Tensorflow Lite 2.5.1, we can install through:
+But in our case, with Tensorflow Lite 2.5.0, we can install through:
```
pip3 install --extra-index-url https://google-coral.github.io/py-repo/ tflite_runtime