Who is this for?

This is an introductory topic for software developers who want to learn how to profile the performance of Machine Learning (ML) models running on Arm devices.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Profile the execution times of ML models on Arm devices.
  • Profile ML application performance on Arm devices.
  • Describe how profiling can help optimize the performance of Machine Learning applications.

Prerequisites

Before starting, you will need the following:

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll profile the performance of an ML application on an Arm-powered Android device. First, you’ll use Streamline to sample system performance metrics and view them on a timeline, then use Android Studio Profiler to investigate memory use and leaks. You’ll also use Arm NN ExecuteNetwork to run a LiteRT model outside your app, examine its layer timings, and identify model bottlenecks. Finally, you’ll adapt ExecuTorch profiling tools for Android.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
How do I know Android Studio is profiling the correct app process?
Open the Profiler window, attach your device in Developer Mode with a USB cable, and select your app’s process.
What timeline scale should I use to see the example app's annotations?
Set the Streamline timeline view scale to 10 µs. The example app’s inference is fast, so this scale makes its Custom Activity Map annotations easier to see.
Why does the ExecuteNetwork command run the model twice?
Running the ExecuteNetwork command runs the model twice because of the --iterations 2 flag. The first run includes startup costs and one-off optimizations, so a second run is useful as the more representative performance measurement. The command writes layer timings to modelout.txt.
How do I check whether inference is the main bottleneck?
Use Streamline annotations to mark inference, preprocessing, and postprocessing in the timeline. You can then see where your app spends time and how busy the CPU or GPU is during each part. For LiteRT with Arm NN, use ExecuteNetwork for layer timings. Without Arm NN, treat ExecuteNetwork results as indicative rather than definitive.
Can I profile a PyTorch model with ExecuTorch on Android?
Yes. ExecuTorch provides profiling tools for PyTorch models. The tools target Linux, but you can adapt the Linux instructions for Android by generating the ETDump file on your Android device and analyzing it with an ExecuTorch Inspector.
Next