Introduction¶
Documentation outline¶
This documentation describes the following aspects of Zephelin and the associated projects:
Introduction - provides general information on Zephelin, its use cases and capabilities
Using and customizing Zephelin - describes how to build, test and use the profiling middleware
Zephelin configuration - describes build-time and runtime configuration of Zephelin library
Memory profiling - describes memory profiling, along with memory events
Tracing code scopes - describes the use of tracing code scopes
Trace capture debug interface - provides information on the debug interface for capturing traces
Instrumentation - shows how to use instrumentation subsystem with Zephelin
CTF to TEF conversion - describes how traces are converted and processed
Adding support for new AI inference libraries - depicts how to track a new runtime
Zephelin Trace Viewer - describes the tool for trace visualization and provides sample applications for various tracing features
Live tracing of events from the board - describes how to trace the execution in real-time
Zephelin usage examples - aggregates and describes various example applications present in the project
Troubleshooting - collects the most common problems with building, capturing and converting traces, along with their solutions
Zephelin’s developer guidelines - summarizes and links resources regarding development of Zephelin
Zephelin benchmarking - provides details on the overhead introduced by the library based on different options
Zephelin¶
Zephyr Profiling Library (ZPL), or Zephelin for short, is a library which enables capturing and reporting runtime performance metrics, for the profiling and detailed analysis of Zephyr applications, with a special focus on applications running AI/ML inference workloads.
It collects traces from execution with either:
Tracing subsystem and predefined or user-provided events - allowing to track functions, sections of code, loops, etc.
Instrumentation subsystem - allowing to leverage the instrumentation feature of a compiler to automatically trace functions defined in the source, with a possibility to filter functions of interest
Zephelin is an official external module for Zephyr RTOS.
Use cases for Zephelin¶
Zephelin can be used to analyze:
Regular Zephyr applications
Internals of the Zephyr RTOS with the help of the instrumentation subsystem
AI models
AI runtimes
Multithreaded applications
Zephelin trace collection¶
Zephelin collects:
Traces
User-defined code scopes
CPU load
Memory usage (from runtime and RAM/ROM reports)
Die temperature
Model-related data:
Global - inference time
Per-layer:
Memory consumption
Total runtime of each layer, and of each layer type
Dimensions of tensors
The above data is later processed by west zpl-<backend>-capture commands (described in Trace collection) and enhanced using west zpl-prepare-trace (described in CTF and TEF trace processing).