diff options
author | Colm Donelan <Colm.Donelan@arm.com> | 2021-05-04 16:12:34 +0100 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2021-05-10 13:06:33 +0000 |
commit | 00c422c4bd62356f4a9978d9e92d862c1273728a (patch) | |
tree | d324963eb40ade31adfe19dd728f0874f2a01617 /delegate/BuildGuideNative.md | |
parent | 01bc02d57fc9cbefeb53fbc79a8f0b5d28f87873 (diff) | |
download | armnn-00c422c4bd62356f4a9978d9e92d862c1273728a.tar.gz |
IVGCVSW-5939 Fixing broken links in IntegrateDelegateIntoPython.md
* Fixing broken links in IntegrateDelegateIntoPython.md
* Adding TFLite Model Benchmark Tool to BuildGuidenative.md
Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: I41b7e1fb1dc7b5a95a5ab2a1ad2207150251e835
Diffstat (limited to 'delegate/BuildGuideNative.md')
-rw-r--r-- | delegate/BuildGuideNative.md | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/delegate/BuildGuideNative.md b/delegate/BuildGuideNative.md index ec1dc4994d..62aa5c0eda 100644 --- a/delegate/BuildGuideNative.md +++ b/delegate/BuildGuideNative.md @@ -175,7 +175,6 @@ If you have built for Gpu acceleration as well you might want to change your tes ./DelegateUnitTests --test-suite=*CpuAcc*,*GpuAcc* ``` - # Build the Delegate together with Arm NN In the introduction it was mentioned that there is a way to integrate the delegate build into Arm NN. This is @@ -208,6 +207,34 @@ make ``` The delegate library can then be found in `build/armnn/delegate`. +# Test the Arm NN delegate using the [TFLite Model Benchmark Tool](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/tools/benchmark) + +The TFLite Model Benchmark Tool has a useful command line interface to test delegates. We can use this to demonstrate the use of the Arm NN delegate and its options. + +Some examples of this can be viewed in this [YouTube demonstration](https://www.youtube.com/watch?v=NResQ1kbm-M&t=920s). + +## Download the TFLite Model Benchmark Tool + +Binary builds of the benchmarking tool for various platforms are available [here](https://www.tensorflow.org/lite/performance/measurement#native_benchmark_binary). In this example I will target an aarch64 Linux environment. I will also download a sample uint8 tflite model from the [Arm ML Model Zoo](https://github.com/ARM-software/ML-zoo). + +```bash +mkdir $BASEDIR/benchmarking +cd $BASEDIR/benchmarking +# Get the benchmarking binary. +wget https://storage.googleapis.com/tensorflow-nightly-public/prod/tensorflow/release/lite/tools/nightly/latest/linux_aarch64_benchmark_model -O benchmark_model +# Make it executable. +chmod +x benchmark_model +# and a sample model from model zoo. +wget https://github.com/ARM-software/ML-zoo/blob/master/models/image_classification/mobilenet_v2_1.0_224/tflite_uint8/mobilenet_v2_1.0_224_quantized_1_default_1.tflite?raw=true -O mobilenet_v2_1.0_224_quantized_1_default_1.tflite +``` + +## Execute the benchmarking tool with the Arm NN delegate +```bash +cd $BASEDIR/benchmarking +LD_LIBRARY_PATH=../armnn/build ./benchmark_model --graph=mobilenet_v2_1.0_224_quantized_1_default_1.tflite --external_delegate_path="../armnn/build/delegate/libarmnnDelegate.so" --external_delegate_options="backends:CpuAcc;logging-severity:info" +``` +The "external_delegate_options" here are specific to the Arm NN delegate. They are used to specify a target Arm NN backend or to enable/disable various options in Arm NN. A full description can be found in the parameters of function [tflite_plugin_create_delegate](namespacetflite.xhtml). + # Integrate the Arm NN TfLite Delegate into your project The delegate can be integrated into your c++ project by creating a TfLite Interpreter and @@ -228,5 +255,7 @@ std::unique_ptr<TfLiteDelegate, decltype(&armnnDelegate::TfLiteArmnnDelegateDele // Instruct the Interpreter to use the armnnDelegate armnnDelegateInterpreter->ModifyGraphWithDelegate(theArmnnDelegate.get()); ``` -For further information on using TfLite Delegates -please visit the [tensorflow website](https://www.tensorflow.org/lite/guide) + +For further information on using TfLite Delegates please visit the [tensorflow website](https://www.tensorflow.org/lite/guide) + +For more details of the kind of options you can pass to the Arm NN delegate please check the parameters of function [tflite_plugin_create_delegate](namespacetflite.xhtml). |