The Roofline Model is an analytical performance model that visualizes the attainable floating-point operations per second (FLOPS) of a computational kernel as a function of its operational intensity. It plots performance against operational intensity, creating a region bounded by two fundamental hardware limits: the peak compute throughput (the 'roofline') and the peak memory bandwidth (the 'ridge point'). This creates a characteristic roofline shape, showing whether a kernel is compute-bound or memory-bound.
Glossary
Roofline Model

What is the Roofline Model?
The Roofline Model is a visual performance model used to analyze the computational efficiency of algorithms and kernels on specific hardware.
For hardware-aware model design, the model guides optimization. Kernels below the roofline are inefficient; engineers restructure them to increase operational intensity (e.g., via loop tiling or operator fusion) to approach the compute roof. It is a cornerstone of design space exploration, used with hardware-in-the-loop evaluation to co-design algorithms and architectures, ensuring efficient use of memory hierarchy and accelerators like NPUs or Tensor Cores.
Key Components of the Roofline Plot
The Roofline Model visualizes the performance limits of a computational kernel by plotting attainable operations per second against operational intensity, bounded by hardware ceilings.
Operational Intensity
Defined as the ratio of total floating-point operations (FLOPs) performed to the total bytes of data moved between the processor and main memory (DRAM). It is measured in FLOPs/byte.
- Low Intensity: Kernels are memory-bound (e.g., element-wise operations, sparse matrix-vector multiply). Performance is limited by memory bandwidth.
- High Intensity: Kernels are compute-bound (e.g., dense matrix-matrix multiplication, convolution). Performance is limited by peak compute throughput.
Attainable Performance (GFLOPs/sec)
The vertical axis of the plot, representing the maximum billions of floating-point operations per second (GFLOPs/sec) a kernel can achieve. This is not a single value but a curve or region determined by the kernel's operational intensity and the hardware's limits.
- For a given intensity, the attainable performance is the minimum of two values: the bandwidth-bound performance and the peak compute performance.
Ridge Point
The critical operational intensity value where the memory-bound and compute-bound performance ceilings intersect. It is calculated as:
Ridge Point = Peak Compute Performance (GFLOPs/sec) / Peak Memory Bandwidth (GB/sec)
- Kernels with intensity below the ridge point are memory-bound.
- Kernels with intensity above the ridge point are compute-bound. This point defines the hardware's inherent balance between compute and memory capabilities.
Memory-Bound Ceiling (Sloped Roof)
The diagonal line on the plot representing the maximum performance achievable when limited by memory bandwidth. Its slope equals the system's peak memory bandwidth.
- Formula:
Attainable GFLOPs/sec = Operational Intensity (FLOPs/byte) * Peak Bandwidth (GB/sec) - This ceiling shows that for memory-bound kernels, performance scales linearly with operational intensity. Improving performance here requires optimizing data reuse (cache locality) to increase intensity or using faster memory.
Compute-Bound Ceiling (Flat Roof)
The horizontal line on the plot representing the maximum performance achievable when limited by peak computational throughput of the hardware (e.g., CPU/GPU/TPU).
- This ceiling is defined by the hardware's maximum FLOPs/sec, considering factors like vector width, core count, and clock frequency.
- Kernels in this region have high operational intensity and are limited by how fast the arithmetic units can process data already in registers or caches. Performance improvements require better utilization of SIMD units, Tensor Cores, or improving instruction-level parallelism.
Kernel Plotting & Optimization Insight
Individual computational kernels are plotted as points or regions on the Roofline model based on their measured operational intensity and achieved GFLOPs/sec.
- Location Reveals Bottleneck: A point far below the roofline indicates underutilization of hardware due to suboptimal implementation, poor cache locality, or inefficient instructions.
- Optimization Vector: The vertical distance from a kernel's point to the roofline shows the headroom for optimization. The direction (moving up vs. moving right) indicates whether to focus on compute micro-optimizations or memory access patterns.
Memory Bound vs. Compute Bound: A Comparison
This table contrasts the defining characteristics, performance bottlenecks, and optimization strategies for computational kernels classified under the Roofline Model.
| Characteristic | Memory Bound | Compute Bound |
|---|---|---|
Primary Performance Limiter | Memory bandwidth (bytes/sec) | Compute throughput (FLOPs/sec) |
Operational Intensity (OI) | Low (OI < Machine Balance) | High (OI > Machine Balance) |
Typical Kernel Behavior | Frequent data movement, low arithmetic intensity | Heavy arithmetic, data reuse in registers/cache |
Dominant Hardware Metric | Memory bus utilization, cache misses | ALU/FPU/Tensor Core utilization |
Example Optimization Strategy | Loop tiling, data layout transformation, prefetching | Loop unrolling, kernel fusion, using specialized compute units (e.g., Tensor Cores) |
Key Profiling Signal | High L1/L2 cache miss rate, low FLOPs/byte | High FLOP utilization, low memory bus traffic |
Improvement Lever | Increase data locality, reduce working set size | Increase arithmetic intensity, exploit instruction-level parallelism |
Roofline Model Position | Left of the ridge point (on the memory-bound slope) | Right of the ridge point (on the compute-bound plateau) |
Practical Applications in AI/ML
The Roofline Model is a foundational tool for performance analysis, used to identify whether a computational kernel is limited by the processor's arithmetic capabilities or by its memory bandwidth.
Core Definition & Visual Model
The Roofline Model is an analytical performance model that plots the attainable FLOPS (Floating-Point Operations Per Second) of a kernel against its Operational Intensity (Ops/Byte). The plot features two distinct ceilings:
- Flat, memory-bound roof: Dictated by peak memory bandwidth.
- Sloped, compute-bound roof: Dictated by peak computational throughput. A kernel's performance is represented by a single point on this plot. Its vertical distance from the roofline indicates the potential performance left on the table, guiding optimization efforts.
Identifying Performance Bottlenecks
The model's primary application is diagnosing the fundamental limiter of an algorithm's performance on given hardware.
- Memory-Bound Kernels: Points falling on the horizontal roof. Performance is gated by how quickly data can be moved from memory. Optimization focuses on improving data reuse, cache blocking, and reducing unnecessary transfers.
- Compute-Bound Kernels: Points falling on the sloped roof. Performance is gated by the processor's arithmetic units. Optimization focuses on improving instruction-level parallelism, using vectorized instructions (e.g., AVX, NEON), and leveraging specialized units like Tensor Cores or NPUs.
Hardware-Aware Model Co-Design
The Roofline Model is essential for Hardware-Aware Neural Architecture Search (NAS) and efficient model design. Engineers use it to:
- Evaluate candidate neural network layers (e.g., standard vs. depthwise separable convolutions) for a target chip.
- Set quantitative targets for model compression techniques like pruning and quantization, aiming to shift a kernel's operational intensity rightward into the compute-bound region.
- Guide the design of custom operators and kernel fusion strategies to minimize memory traffic and maximize operational intensity.
Optimizing for Specific Hardware
Different hardware platforms have unique rooflines. The model forces explicit consideration of:
- Mobile CPUs/GPUs: Typically have a relatively low compute roof and moderate memory bandwidth, favoring extremely efficient operators.
- Data Center GPUs (e.g., NVIDIA H100): Feature an exceptionally high compute roof (from Tensor Cores) but require very high operational intensity to saturate it.
- Neural Processing Units (NPUs): Have rooflines shaped by their specialized matrix engines and on-chip memory hierarchies. Optimization involves tailoring dataflow and operator choices to match this profile.
Inference Optimization & Latency Prediction
For on-device inference optimization, the Roofline Model provides a first-order latency estimate: Latency ≈ (Total Operations / Attainable FLOPS). By analyzing a model's layer-by-layer operational intensity, engineers can:
- Pinpoint layers causing the most significant performance bottlenecks.
- Apply targeted optimizations like post-training quantization to reduce memory footprint and potentially increase operational intensity.
- Use the model to validate the effectiveness of compiler optimizations performed by frameworks like TVM or TensorRT.
Limitations and Modern Extensions
The classic Roofline Model has limitations that practitioners must acknowledge:
- It assumes perfect overlap of compute and memory operations.
- It does not model cache hierarchies, parallelism, or power consumption.
- It treats operational intensity as a single, fixed value.
Modern extensions address these:
- Hierarchical Roofline Models: Add roofs for each level of the cache (L1, L2, LLC).
- Multi-Roofline Models: Account for different instruction types (e.g., FP32, INT8, Tensor Core ops).
- Execution-Cache-Memory (ECM) Model: A more predictive model that incorporates in-core execution time and data transfer times through the cache hierarchy.
Frequently Asked Questions
The Roofline Model is a foundational analytical tool for hardware-aware machine learning. It provides a visual and quantitative framework for understanding the fundamental performance limits of a computational kernel, algorithm, or neural network layer on a specific hardware platform. By plotting attainable performance against operational intensity, it reveals whether a computation is bounded by the processor's peak compute capability or by the memory system's bandwidth.
The Roofline Model is an analytical performance model that visualizes the attainable performance of a computational kernel as a function of its operational intensity, bounded by the hardware's peak compute throughput and memory bandwidth. It works by creating a two-dimensional plot where the x-axis is operational intensity (operations per byte of DRAM traffic) and the y-axis is performance (operations per second). The model establishes two fundamental ceilings: a horizontal compute roof defined by the processor's peak FLOP/s, and a diagonal bandwidth roof defined by the product of operational intensity and peak memory bandwidth (GB/s). The attainable performance for any kernel is the minimum of these two ceilings at its specific operational intensity, instantly diagnosing whether it is compute-bound or memory-bound.
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 provides a foundational framework for performance analysis. These related concepts are essential for engineers performing the hardware-aware co-design it enables.
Operational Intensity
The key independent variable in the Roofline Model. It is defined as the ratio of total floating-point operations (FLOPs) performed by a kernel to the total bytes of data moved between the processor and main memory (DRAM).
- Measured in: FLOPs/byte.
- Determines Locality: A high operational intensity indicates high data reuse (compute-bound). A low value indicates frequent memory accesses (memory-bound).
- Example: A dense matrix multiplication has high operational intensity. An element-wise vector operation has very low operational intensity.
Arithmetic Intensity
Often used synonymously with Operational Intensity. Precisely, it is the number of arithmetic operations (not necessarily floating-point) per byte of data transfer. In the context of the Roofline Model for deep learning, FLOPs are the standard metric, making the terms functionally equivalent for performance modeling on GPUs and NPUs.
Roofline
The performance limit curve in the model. It consists of two distinct regions:
- Memory-Bound Roof (Sloped): Performance is limited by the system's peak memory bandwidth. Attainable GFLOPs/sec = (Operational Intensity) × (Peak Bandwidth in GB/s).
- Compute-Bound Roof (Flat): Performance is limited by the processor's peak computational throughput. Attainable performance caps at the hardware's peak GFLOPs/sec. The intersection point where these two limits meet is the ridge point or machine balance, defining the minimum operational intensity required to achieve peak compute.
Attainable Performance
The actual performance (in GFLOPs/sec) a specific computational kernel can achieve on given hardware, as plotted within the Roofline Model. It is always at or below the roofline.
- The vertical distance from a kernel's plotted point to the roofline represents performance headroom.
- A point on the sloped roof indicates the kernel is optimally memory-bound.
- A point on the flat roof indicates the kernel is optimally compute-bound.
- A point in the interior indicates inefficiencies from suboptimal memory access patterns or underutilized compute units.
Memory Bandwidth
The rate at which data can be read from or written to the main memory (e.g., HBM, DDR). It is the fundamental hardware constraint for the memory-bound region of the roofline.
- Measured in: GB/s (Gigabytes per second).
- Determinants: Memory technology (DDR5, HBM3), bus width, and frequency.
- Real-World vs. Peak: The achievable bandwidth for a specific kernel depends heavily on access patterns (coalesced vs. scattered). The roofline uses the hardware's theoretical peak, but effective bandwidth can be lower.
Peak Compute Throughput
The maximum number of floating-point operations a processor can perform per second, defining the flat ceiling of the roofline.
- Measured in: GFLOPs/sec or TFLOPS/sec.
- Determinants: Clock frequency, number of cores, and SIMD width.
- Precision Matters: Peak throughput is specified for a data type (e.g., FP32, FP16, INT8). Modern accelerators like Tensor Cores have vastly different peaks for different precisions, requiring separate rooflines for mixed-precision analysis.

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