This guide explains how to use Streamline to profile the AlexNet example application from the Arm Compute Library for both the Raspberry Pi and the HiKey 960 board.
Arm’s Machine Learning (ML) platform, enables new applications and capabilities. It is important that you monitor your software's performance to ensure that algorithms and applications deliver excellent user experiences.
You can do this using Arm's Streamline, a performance analyzer that makes it easy to profile and optimize your software for running on Arm-based processors.
AlexNet is a convolutional neural network (CNN) that performs image feature classification from a training set of 1000 images.
The Arm Compute Library provides a way to address performance and portability challenges. It helps you to avoid rewriting applications for different target hardware and gives you confidence that lower-level functionality is optimized.
In this guide, we explain how to run the AlexNet example on two different hardware platforms. The first section covers Raspberry Pi 3 running Ubuntu MATE and the second section covers the HiKey 960 development platform running Android AOSP. The Raspberry Pi 3 contains four Arm Cortex-A53 cores, and the Hikey 960 is based on an Arm big.LITTLE processor with four Arm Cortex-A73 and four Cortex-A53 cores. You can also use the Raspberry Pi 4 to do this.
Running on two different platforms demonstrates the flexibility of the Arm Compute Library. This guide also provides tips on setting up each platform, and uses Streamline to show differences in how the Arm Compute Library runs on different hardware.
Continue on through this guide to starting learning how you can profile on Raspberry Pi. Or, if you want to jump straight to how to profile for the Hikey 960, go to Install and build Compute Library on HiKey 960.
Before you begin
Read this section and familiarize yourself with what you need before you start the guide.
- Raspberry Pi 2, 3 or 4 with internet access.
- A blank Micro SD card. We recommend an 8GB (minimum 6GB) Class 6 or Class 10 microSDHC card for installing the Raspberry Pi OS and storing the CNN model.
- Arm DS-5 installed on a host PC running Windows or Linux.
- Router and ethernet cable. This is to connect to the Raspberry Pi from a host PC using SSH.
Set up Ubuntu MATE
Set up your Pi with Ubuntu MATE and prepare it for SSH access from a separate host machine. The general steps for this are:
- Download the Ubuntu MATE 16.04.02 image file.
- Uncompress it using unxz.
- Write the image to the MicroSD card, we use dd on Linux but there are many ways.
- Insert the MicroSD card in a Raspberry Pi 3 and start it up.
Once the new system starts up, go through the configuration steps and connect to the network using a wired or wireless connection from your host machine.
Next, enable SSH by entering this on the command line:
$ sudo raspi-config
Then select Interfacing Options:
And then select SSH:
With SSH enabled, use the
ifconfig command to see the IP address of the Pi:
$ ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr b8:27:eb:22:ab:26
inet addr:192.168.0.121 Bcast:192.168.0.255 Mask:255.255.255.0
And then check that you can SSH to it from your host machine.
To save time, you can set up SSH with no password. For example:
$ ssh-copy-id 192.168.0.121