The Roofline Model is a visual performance model that plots the maximum attainable floating-point operations per second (FLOPS) of a computational kernel against its operational intensity. It establishes a hard performance ceiling, or 'roofline,' determined by either the hardware's peak compute capacity or its memory bandwidth. A kernel's performance is bound by the compute roof if it is compute-bound (high operational intensity) or by the memory bandwidth roof if it is memory-bound (low operational intensity). This model provides an intuitive, first-order analysis for optimizing algorithms on specific hardware.
Glossary
Roofline Model

What is the Roofline Model?
The roofline model is an analytical performance model that visualizes the attainable performance of a computational kernel as a function of its operational intensity and the hardware's peak compute and memory bandwidth.
In TinyML benchmarking, the roofline model is crucial for diagnosing bottlenecks in microcontroller inference. By plotting a model's layers, engineers can identify which operators are memory-bound, guiding optimizations like operator fusion to reduce data movement, or compute-bound, suggesting kernel optimization or hardware acceleration. It directly informs the accuracy-latency trade-off and helps architects select efficient neural network architectures that operate near the hardware's performance limits, maximizing frames per second or minimizing energy per inference within severe resource constraints.
Key Components of the Roofline Plot
The Roofline Model is a visual performance ceiling defined by hardware limits. The plot's axes and lines reveal whether a computational kernel is limited by memory bandwidth or raw compute power.
Operational Intensity (X-Axis)
The operational intensity of an algorithm, measured in Operations per Byte (Ops/Byte), is plotted on the logarithmic x-axis. It quantifies the balance between computation and data movement for a kernel.
- Low Intensity (< 1 Ops/Byte): Memory-bound kernels (e.g., vector addition). Performance is gated by how fast data can be loaded.
- High Intensity (> 10 Ops/Byte): Compute-bound kernels (e.g., dense matrix multiplication). Performance is gated by arithmetic units.
- This metric is algorithm-specific and independent of hardware.
Attainable Performance (Y-Axis)
The attainable performance, measured in Giga Operations Per Second (GOP/s), is plotted on the logarithmic y-axis. It represents the actual throughput achievable by a kernel on the target hardware.
- The maximum possible performance for any kernel is capped by the hardware's roofline.
- A kernel's measured performance is plotted as a single point: its operational intensity (x) and achieved GOP/s (y).
- The vertical distance from this point to the roofline shows untapped performance potential.
Memory-Bound Roofline (Slope)
The memory-bound roofline is the diagonal line on the left side of the plot. Its slope equals the system's peak memory bandwidth, measured in Gigabytes per second (GB/s).
- Formula: Attainable Performance = Operational Intensity × Peak Memory Bandwidth.
- Kernels plotted in this region cannot achieve higher GOP/s without reducing data movement or increasing bandwidth.
- For TinyML, this is often the dominant constraint due to slow, power-efficient SRAM/Flash compared to compute.
Compute-Bound Roofline (Flat Ceiling)
The compute-bound roofline is the horizontal line at the top of the plot. Its height equals the hardware's peak computational throughput, measured in GOP/s.
- This ceiling is defined by the maximum operations per second the CPU, GPU, or NPU can execute.
- Kernels with high operational intensity hit this flat ceiling. Their performance cannot increase further without more or faster compute units.
- In practice, this peak is often for a specific precision (e.g., 8-bit integer, FP16).
Kernel Plots & Optimization Target
Individual computational kernels (e.g., a convolutional layer) are plotted as points. Their position relative to the roofline dictates the optimization strategy.
- Point below the roofline: The kernel is inefficient. Optimization should focus on improving software: better cache use, kernel fusion, or instruction selection.
- Point on the memory-bound slope: The kernel is memory-bound. Optimize data layout, use compression, or increase data reuse.
- Point on the compute-bound ceiling: The kernel is compute-bound. Optimize with vectorization, parallelization, or using a lower precision format.
Hardware-Specific Rooflines
A single system can have multiple, stacked rooflines representing different hardware configurations or precision levels.
- Different Cores: One roofline for a Cortex-M4 CPU, another for an integrated micro-NPU.
- Different Numeric Precision: A lower, higher ceiling for 32-bit float ops, and a higher ceiling for 8-bit integer ops.
- Cache Hierarchies: Separate rooflines can be drawn for bandwidth from L1 cache vs. main memory, showing the performance cliff when data spills out of cache.
- This reveals the optimal hardware target and data type for a given kernel.
Applying the Roofline Model to TinyML
This table compares the performance characteristics of three hypothetical TinyML kernels when analyzed through the roofline model, highlighting their operational intensity and limiting factors on a target microcontroller.
| Performance Metric / Kernel | Keyword Spotting Kernel | Wake-Word Detection Kernel | Anomaly Detection Kernel |
|---|---|---|---|
Operational Intensity (OPS/Byte) | 0.8 | 0.3 | 2.5 |
Attainable Performance (GOPS) | 4.8 | 2.4 | 8 |
Limiting Factor | Memory Bound | Memory Bound | Compute Bound |
Peak Memory Bandwidth (GB/s) | 6 | 6 | 6 |
Peak Compute (GOPS) | 10 | 10 | 10 |
Typical Layer Types | Depthwise Conv, FC | 1D Conv, GRU | Standard Conv, FC |
Primary Optimization Target | Memory Access | Memory Access & Quantization | Arithmetic Unit Utilization |
Potential Speedup via Kernel Fusion |
Frequently Asked Questions
The Roofline Model is a foundational analytical tool for understanding the performance limits of computational kernels on specific hardware. These questions address its core concepts, application in TinyML, and practical use for developers.
The Roofline Model is an analytical performance model that visualizes the attainable performance of a computational kernel as a function of its operational intensity and the hardware's peak compute throughput and memory bandwidth. It works by plotting performance (e.g., Giga Operations Per Second - GOPS) against operational intensity (Operations/Byte). The model creates two defining "rooflines": a flat, bandwidth-bound roof set by the memory system's maximum data transfer rate, and a sloping, compute-bound roof set by the processor's peak arithmetic throughput. The attainable performance of any given algorithm is the minimum of these two ceilings at its specific operational intensity, instantly revealing whether it is limited by computation or data movement.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
The Roofline Model is a cornerstone of performance analysis. These related concepts are essential for understanding the trade-offs and bottlenecks it reveals in TinyML systems.
Operational Intensity
Operational intensity is the fundamental metric that positions an algorithm on the Roofline Model's x-axis. It is defined as the number of operations (e.g., FLOPs or MACCs) performed per byte of data transferred from main memory.
- High intensity (>10 Ops/Byte) indicates a compute-bound kernel, where performance is limited by the processor's arithmetic units.
- Low intensity (<1 Ops/Byte) indicates a memory-bound kernel, where performance is limited by memory bandwidth. For TinyML, optimizing data reuse to increase operational intensity is a key strategy to approach the compute roof.
Compute Bound vs. Memory Bound
These are the two fundamental performance regimes defined by the Roofline Model.
- A workload is compute-bound when its operational intensity is high enough that its attainable performance is capped by the hardware's peak computational throughput (the 'flat roof'). Further optimization requires improving arithmetic efficiency or using specialized compute units like NPUs.
- A workload is memory-bound when its operational intensity is low, placing it on the model's 'sloped roof.' Here, performance scales linearly with operational intensity and is limited by the available memory bandwidth. For memory-bound TinyML layers, techniques like operator fusion or improved cache locality are critical.
Peak Memory Usage
Peak memory usage is the maximum amount of RAM (SRAM/DRAM) consumed during inference, including model weights, activations, and intermediate buffers. It is a critical constraint in the Roofline Model's memory bandwidth calculation.
- High peak usage can force frequent data movement between slow external memory and fast caches, lowering effective bandwidth and pushing the system into a memory-bound regime.
- TinyML optimization techniques like activation sparsity, weight pruning, and efficient memory scheduling directly reduce peak usage, effectively raising the sloped memory roof for a given hardware platform.
MACC Count (Multiply-Accumulate Operations)
The MACC count quantifies the computational workload of a neural network and is a primary component in calculating operational intensity for the Roofline Model.
- It represents the total number of fused multiply-and-add operations required for a forward pass.
- Combined with the total bytes of data accessed (weights + activations), it determines the algorithm's position on the x-axis:
Operational Intensity = Total MACCs / Total Bytes Accessed. - For a fixed memory bandwidth, a higher MACC count (if data access is controlled) increases operational intensity, moving the kernel closer to the compute roof.
Hardware-in-the-Loop (HIL) Testing
Hardware-in-the-loop testing is the empirical methodology used to gather the precise performance data needed to construct an accurate Roofline Model for a specific TinyML deployment.
- It involves running the actual model on the target microcontroller within a controlled test environment.
- HIL testing measures the real throughput (FPS) and actual memory bandwidth utilization, which are used to plot the empirical performance point and draw the hardware's theoretical roofs.
- Without HIL validation, a Roofline analysis remains purely theoretical and may not reflect real-world bottlenecks like cache effects or DMA overhead.
Layer-wise Profiling
Layer-wise profiling is the granular analysis technique that decomposes a model's performance according to the Roofline Model. Instead of one point for the whole network, each layer (e.g., Conv2D, Fully Connected) is analyzed individually.
- This reveals which specific layers are compute-bound and which are memory-bound, guiding targeted optimization.
- A memory-bound convolutional layer might benefit from loop tiling, while a compute-bound fully connected layer might benefit from quantization to use integer arithmetic units.
- This detailed view is essential for effective model architecture search and kernel optimization on microcontrollers.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us