The Roofline Model is an analytical performance model that visually relates an application's arithmetic intensity—the number of operations per byte of DRAM traffic—to its attainable performance, which is bounded by either the hardware's peak compute throughput or its memory bandwidth. It provides a visual 'roofline' that represents the absolute performance ceiling for a given hardware platform, classifying kernels as either compute-bound or memory-bound based on their operational characteristics.
Glossary
Roofline Model

What is the Roofline Model?
The Roofline Model is a visual performance model used to analyze the theoretical limits of computational kernels on parallel hardware.
For compiler engineers optimizing kernel fusion, the model is essential for diagnosing bottlenecks. Fusing multiple operations increases arithmetic intensity by keeping intermediate results in registers or caches, moving the kernel's performance point to the right on the roofline chart. This shift can transition a kernel from being limited by memory bandwidth to being limited by peak compute, thereby achieving higher FLOPS and validating the efficacy of fusion and other memory hierarchy optimizations.
Key Components of the Roofline Model
The Roofline Model visualizes the fundamental performance limits of a computational kernel or application on a given hardware architecture. It provides a two-dimensional plot relating operational intensity to attainable performance, bounded by either peak compute throughput or memory bandwidth.
Operational Intensity
Operational Intensity is the primary x-axis metric in the Roofline Model, defined as the number of floating-point operations (FLOPs) performed per byte of data transferred between the processor and main memory (DRAM). It is calculated as:
- Formula: Operational Intensity = Total FLOPs / Total DRAM Bytes Transferred
- High Intensity: Kernels with high operational intensity (e.g., dense matrix multiplication) are compute-bound.
- Low Intensity: Kernels with low operational intensity (e.g., element-wise vector addition) are memory-bound. This metric classifies an application's fundamental bottleneck.
Attainable Performance
Attainable Performance is the primary y-axis metric, measured in GigaFLOPs per second (GFLOPS) or TeraFLOPs per second (TFLOPS). It represents the actual computational throughput achieved by a kernel. In the Roofline plot:
- A point's vertical position shows its measured performance.
- The roofline ceiling above it shows the maximum possible performance for its operational intensity.
- The gap between the point and the ceiling indicates performance optimization headroom. The goal of kernel fusion and other optimizations is to move points vertically toward the roofline.
Ridge Point
The Ridge Point is the critical operational intensity value where the performance limit transitions from being constrained by memory bandwidth to being constrained by peak computational throughput. It is calculated as:
- Formula: Ridge Point = Peak Memory Bandwidth (GB/s) / Peak Compute Performance (GFLOPS/byte)
- Left of Ridge: Applications are memory-bound; performance scales linearly with operational intensity.
- Right of Ridge: Applications are compute-bound; performance is capped at the hardware's peak FLOP/s rate. This point defines the two fundamental regimes of the model.
Memory-Bound Ceiling
The Memory-Bound Ceiling is the diagonal line on the left side of the roofline plot. It represents the maximum performance achievable when an application is limited by the system's memory bandwidth.
- Slope = Bandwidth: The slope of this line equals the system's peak memory bandwidth (in units of GFLOPS per byte).
- Governing Law: Performance ≤ Operational Intensity × Peak Memory Bandwidth.
- Optimization Target: For kernels under this ceiling, optimizations must focus on reducing DRAM traffic (e.g., via kernel fusion, tiling, improving memory coalescing) to increase effective operational intensity and move the point to the right.
Compute-Bound Ceiling
The Compute-Bound Ceiling is the horizontal line on the right side of the roofline plot. It represents the maximum performance achievable when an application is limited by the processor's raw computational capabilities.
- Flat Line: Performance is capped at the hardware's peak FLOP/s rate, regardless of increased operational intensity.
- Governing Law: Performance ≤ Peak Compute Throughput.
- Optimization Target: For kernels under this ceiling, optimizations must focus on improving computational efficiency (e.g., increasing kernel occupancy, leveraging tensor cores, maximizing instruction-level parallelism) to move the point vertically toward the flat ceiling.
Application in NPU Optimization
For Neural Processing Unit (NPU) acceleration, the Roofline Model is used to:
- Diagnose Bottlenecks: Identify if a fused kernel or model layer is memory-bound or compute-bound on the target NPU.
- Guide Kernel Fusion: Fusing multiple operations (e.g., Conv + Bias + ReLU) increases operational intensity by keeping intermediate data in fast on-chip memory, moving the kernel's point to the right on the plot, potentially crossing the ridge point into the compute-bound region.
- Evaluate Hardware Fit: Compare the rooflines of different NPUs to select the best architecture for a specific AI workload's operational intensity profile.
- Set Optimization Goals: Quantify the performance gap to the ceiling, providing a clear target for compiler engineers and performance architects.
Application Classification via the Roofline Model
This table classifies computational kernels based on their operational intensity relative to a system's hardware ceilings, identifying the primary performance bottleneck and the corresponding optimization strategy.
| Classification | Arithmetic Intensity (AI) Range | Primary Performance Bound | Dominant Bottleneck | Key Optimization Strategy |
|---|---|---|---|---|
Memory-Bound | AI < AI_balance (Peak BW / Peak FLOPs) | Attainable GFLOPs/sec = AI * BW_peak | Memory Bandwidth (BW) | Reduce data movement, improve data reuse, optimize memory access patterns (coalescing). |
Compute-Bound | AI > AI_balance | Attainable GFLOPs/sec = Peak FLOPs | Compute Throughput (FLOPs) | Increase arithmetic intensity, leverage specialized units (Tensor Cores), optimize instruction mix. |
Latency-Bound | N/A (Low Concurrency) | Performance << Roofline | Instruction/Memory Latency, Low Occupancy | Increase parallelism, hide latency via software pipelining, improve kernel occupancy. |
Cache-Bound / L1/L2 Bound | AI between memory and compute bounds | Performance limited by cache bandwidth | Cache-to-Register Bandwidth | Optimize for data locality (tiling), manage shared memory, reduce register spilling. |
Roofline At-Ceiling | AI at or near AI_balance | Performance at intersection of BW and FLOPs ceilings | Balanced System Pressure | Fine-tune for both compute and memory optimizations; system is optimally utilized. |
I/O-Bound | Extremely Low AI | Performance << Memory-Bound Roofline | PCIe/NVLink/Storage Bandwidth | Overlap computation with data transfer (async), use pinned memory, batch data transfers. |
Frequently Asked Questions
The Roofline Model is a foundational analytical tool for performance engineers and compiler architects. It provides a visual framework for diagnosing the fundamental bottlenecks—compute or memory—limiting application performance on modern hardware accelerators like NPUs and GPUs.
The Roofline Model is an analytical performance model that visually relates an application's arithmetic intensity (operations per byte of DRAM traffic) to its attainable performance, bounded by either peak compute throughput or memory bandwidth. It works by plotting performance (in FLOPS) on the y-axis against arithmetic intensity (in FLOPs/Byte) on a logarithmic x-axis. The model creates two distinct performance ceilings: a diagonal memory bandwidth roof, where performance is limited by how fast data can be moved, and a horizontal peak compute roof, where performance is limited by the hardware's maximum arithmetic throughput. The attainable performance for any kernel is the minimum of these two ceilings at its specific arithmetic intensity, providing an immediate visual diagnosis of whether the kernel 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 is a cornerstone of performance analysis. To fully leverage it, one must understand the related compiler optimizations, hardware constraints, and performance metrics that define the boundaries of computational efficiency.
Arithmetic Intensity
Arithmetic Intensity is the fundamental metric that determines an application's position on the Roofline Model's x-axis. It is defined as the number of floating-point operations (FLOPs) performed per byte of data transferred between the processor and DRAM. This ratio classifies workloads:
- Compute-Bound: High arithmetic intensity. Performance is limited by the processor's peak FLOP/s.
- Memory-Bound: Low arithmetic intensity. Performance is limited by the available memory bandwidth. Optimizations like kernel fusion and loop tiling directly increase arithmetic intensity by reducing off-chip data movement.
Kernel Fusion
Kernel Fusion is a critical compiler optimization that merges multiple, separate computational kernels into a single, larger kernel. This directly impacts the Roofline Model by:
- Reducing Global Memory Traffic: Eliminates writes and subsequent reads of intermediate results to/from DRAM.
- Increasing Arithmetic Intensity: More operations are performed per byte fetched from memory, potentially moving the workload rightward on the Roofline graph.
- Reducing Launch Overhead: Minimizes latency from repeated kernel invocations. For example, fusing a convolution, bias add, and ReLU activation into one kernel is a standard optimization in deep learning compilers like TVM or XLA.
Memory Bandwidth
Memory Bandwidth is the hardware ceiling that forms the sloping 'roof' in the Roofline Model. It represents the maximum rate (in GB/s) at which data can be read from or written to main memory. The attainable performance for a memory-bound kernel is calculated as Performance ≤ Arithmetic Intensity × Peak Bandwidth. Key factors include:
- Memory Hierarchy: Effective bandwidth to caches (L1, L2) is orders of magnitude higher than to DRAM.
- Memory Coalescing: An optimization where concurrent memory accesses from threads in a warp are combined into a single transaction, maximizing effective bandwidth utilization.
- Hardware-Specific: Peak bandwidth is a fixed property of the accelerator (e.g., NVIDIA H100: ~3.35 TB/s).
Peak Compute Throughput
Peak Compute Throughput is the horizontal ceiling in the Roofline Model, representing the maximum FLOP/s the hardware can sustain. This is the limiting factor for compute-bound applications. It is determined by:
- Clock Frequency and Core Count of the processor.
- Specialized Units: The presence of Tensor Cores or Matrix Engines that provide vastly higher throughput for specific operations (e.g., FP16/BF16 matrix multiplies).
- Numerical Precision: Peak throughput is typically quoted for a specific precision (e.g., FP32, FP16, INT8). A kernel must use the hardware's most efficient data types and instructions to approach this theoretical peak.
Loop Tiling
Loop Tiling (or blocking) is a loop transformation that partitions a large iteration space into smaller blocks or 'tiles'. This optimization is essential for moving data efficiently within the memory hierarchy, directly influencing a kernel's effective arithmetic intensity.
- Principle: Size tiles to fit the working set of data into a faster, smaller memory (e.g., shared memory on a GPU or cache on a CPU).
- Impact: Dramatically reduces accesses to slow global memory, increasing the operational intensity within the tile.
- Roofline Context: Successful tiling can shift a kernel's performance from the memory-bound slope to beneath the compute-bound ceiling on the model.
Auto-Tuning
Auto-Tuning is an empirical, search-based optimization process used to find the best-performing configuration for a kernel on specific hardware. It directly operationalizes the Roofline Model's insights.
- Search Space: Explores parameters like tile sizes, loop unroll factors, vector widths, and thread block dimensions.
- Objective: Maximize performance by minimizing execution time, which on the Roofline Model means pushing the kernel's performance point as high as possible under the relevant roof.
- Frameworks: Tools like Ansor (TVM) and Triton use auto-tuning to automatically generate high-performance kernels, navigating the trade-offs between memory bandwidth and compute utilization implied by the Roofline 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