A cache miss occurs when a processor or accelerator, such as a Neural Processing Unit (NPU), requests data that is not present in its high-speed cache memory. This forces the system to access a slower, lower level of the memory hierarchy, like main memory (DRAM) or High Bandwidth Memory (HBM), incurring a significant latency penalty. The frequency of cache misses is a primary determinant of overall system performance, as the processor stalls while waiting for data.
Glossary
Cache Miss

What is a Cache Miss?
A cache miss is a fundamental performance event in computer architecture where requested data is not found in a fast cache, triggering a costly fetch from a slower, lower level of the memory hierarchy.
Cache misses are categorized by cause. A compulsory miss (or cold miss) happens on the first access to a block of data. A capacity miss occurs when the working set exceeds the cache size, evicting needed data. A conflict miss arises in set-associative caches when multiple memory blocks map to the same cache set. Effective memory hierarchy management relies on optimizing memory access patterns and leveraging prefetching to minimize these misses and mitigate the memory wall.
Key Characteristics of Cache Misses
A cache miss is not a singular event but a category with distinct types, causes, and measurable impacts on system performance. Understanding these characteristics is essential for optimizing memory hierarchy management in NPUs and other accelerators.
The Three Fundamental Miss Types
Cache misses are formally categorized by their underlying cause, which dictates the optimization strategy.
- Compulsory Miss (Cold Miss): The first access to a block of data that has never been in the cache. This is unavoidable without infinite cache size or perfect prefetching.
- Capacity Miss: Occurs when the working set of the program is larger than the cache capacity, forcing eviction of blocks that will be needed again.
- Conflict Miss: Happens in set-associative or direct-mapped caches when multiple memory blocks map to the same cache set, causing thrashing even if the cache has sufficient total capacity.
Performance Impact: The Miss Penalty
The miss penalty is the critical metric quantifying a cache miss's cost. It is the additional time required to service the miss versus a hit.
- Measured in Cycles: The penalty is the number of processor clock cycles stalled waiting for data from the next memory level (e.g., L2 cache, DRAM).
- Hierarchical: Penalties escalate dramatically down the memory hierarchy (e.g., L1 miss to L2: ~10 cycles; L3 miss to DRAM: ~200+ cycles).
- Bandwidth Saturation: A high miss rate can saturate the memory bus, increasing the effective penalty for all subsequent misses.
Measuring Miss Rates
The miss rate is the primary statistic for cache performance analysis, calculated as Misses / Total Accesses.
- Absolute vs. Relative: A low absolute rate (e.g., 1%) can still cause severe slowdowns if the program executes billions of memory accesses.
- MPKI: Misses Per Kilo-Instruction is often a more stable metric than a percentage rate, as it is independent of the total number of cache accesses.
- Profiling Tools: Hardware performance counters (e.g., via
perfon Linux or VTune) are used to precisely measure cache misses during execution.
Spatial vs. Temporal Locality Violations
Cache misses directly result from poor exploitation of the two core locality principles.
- Temporal Locality Miss: Data was accessed, evicted, and then accessed again before it could be reused. This indicates a working set larger than cache or poor replacement policy.
- Spatial Locality Miss: Data is accessed with a large, unpredictable stride (e.g., random access), wasting the fetched cache line where only a single byte is used. Optimizing data structures for unit stride access is key.
Coherence Misses in Multi-Core Systems
In systems with multiple processors or NPU cores sharing memory, coherence misses add a fourth category.
- Invalidation Miss: Occurs when a cache line is invalidated because another core wrote to it (a write to a shared line). The core must then fetch the updated data.
- False Sharing: A major cause of artificial coherence misses. Threads on different cores modify different variables that happen to reside on the same cache line, triggering unnecessary invalidations and reloads.
Mitigation Strategies
Addressing cache misses involves hardware and software techniques.
- Hardware: Larger caches, higher associativity, smarter prefetchers, and victim caches.
- Software (Most Critical):
- Data Structure Optimization: Align and pack data to fit cache lines.
- Loop Transformations: Tiling/blocking to fit working sets into cache.
- Prefetching Intrinsics: Software-initiated prefetch instructions.
- Memory Access Pattern: Designing algorithms for sequential, predictable access. For NPUs, compiler-driven kernel fusion and scratchpad memory management are essential software mitigations.
How a Cache Miss Works: The Memory Hierarchy
A cache miss is a fundamental performance event in computer architecture where requested data is not found in a processor's fast cache, triggering a costly fetch from a slower, lower level of the memory hierarchy.
A cache miss occurs when a processor core requests data or an instruction that is not present in its local cache memory. This forces the memory controller to retrieve the required cache line from a slower, higher-capacity level, such as main memory (DRAM) or another core's cache in a shared system. The resulting stall introduces significant latency, directly degrading instruction throughput and overall system performance. This event is a primary target for optimization in high-performance computing and AI accelerator design.
The memory hierarchy—comprising registers, L1/L2/L3 caches, main memory, and storage—exists to mitigate the memory wall by exploiting locality of reference. Temporal locality (reuse of data) and spatial locality (access to nearby data) are key principles that make caches effective. When a program's memory access pattern exhibits poor locality, it causes frequent cache misses, overwhelming the available memory bandwidth and becoming a critical bottleneck, especially for data-intensive workloads like neural network inference on NPUs.
Types of Cache Misses (The 3 C's Model)
The 3 C's model categorizes cache misses based on their underlying cause, which is essential for diagnosing and optimizing memory access patterns in NPU and CPU systems.
| Miss Type | Primary Cause | Typical Mitigation | Impact on NPU Performance |
|---|---|---|---|
Compulsory Miss (Cold Miss) | First access to a block of data; the block has never been in the cache. | Prefetching (hardware or software), larger block sizes. | High impact during initial data loading phases; unavoidable for new data. |
Capacity Miss | The working set of the program exceeds the total size of the cache. | Increase cache size, improve data locality, restructure algorithms to use smaller working sets. | Dominant cause of misses when processing large tensors or models that don't fit in cache. |
Conflict Miss (Collision Miss) | Multiple memory blocks map to the same cache set/line, causing evictions even when the cache is not full. | Increase cache associativity, use software techniques like array padding or blocking to change memory address mapping. | Significant impact with low-associativity caches; can cause erratic performance drops. |
Coherence Miss (Invalidation Miss) | In a multi-core/processor system, a cache line is invalidated due to a write by another processor to maintain coherence. | Optimize data partitioning to minimize shared writes, use synchronization primitives effectively. | Critical in multi-NPU or heterogeneous (NPU/CPU) systems; causes cache line flushes and stalls. |
True Sharing Miss | Subset of coherence miss where different processors legitimately read and write the same variable. | Minimize shared mutable data, use thread-local storage, apply fine-grained locking. | Directly increases synchronization overhead and limits parallel scaling. |
False Sharing Miss | Processors access different variables that happen to reside on the same cache line, causing unnecessary invalidations. | Align and pad data structures to cache line boundaries, reorganize data layout. | A silent performance killer; wastes bandwidth and increases latency without functional need. |
Cache Misses in AI & NPU Contexts
A cache miss occurs when requested data is not found in a fast cache, forcing a slower access to main memory. In AI accelerators, this is a primary bottleneck for performance and energy efficiency.
The Core Definition & Performance Impact
A cache miss is a failed attempt by a processor to read or write data in a cache, requiring a fetch from a lower, slower level of the memory hierarchy. This event incurs a performance penalty measured in hundreds of processor cycles. In AI workloads, frequent cache misses can stall the massive parallel compute units in an NPU, drastically reducing throughput and increasing energy consumption per operation. The goal of memory hierarchy optimization is to minimize the miss rate.
Types of Cache Misses
Cache misses are categorized by their cause, guiding optimization strategies:
- Compulsory Miss (Cold Miss): The first access to a memory block. Unavoidable but can be mitigated via prefetching.
- Capacity Miss: Occurs because the working set is larger than the cache size. Solved by algorithmic tiling or using larger caches.
- Conflict Miss: Happens in set-associative caches when multiple memory blocks map to the same cache set, evicting each other. Addressed by improving data layout or increasing associativity.
- Coherence Miss (Invalidation Miss): In multi-core systems, a cache line is invalidated due to a write by another processor. Critical in NUMA systems and for cache coherence protocols.
NPU-Specific Memory Architecture
NPUs often employ a multi-tiered, software-managed memory hierarchy distinct from CPU caches. A typical structure includes:
- Global Memory (HBM/DRAM): High-capacity, high-bandwidth, but high-latency. Source of data on a miss.
- Shared Memory / Local SRAM: A fast, on-chip, software-managed scratchpad memory. Programmers explicitly control data movement here to avoid hardware cache misses.
- Register Files: The fastest storage, directly feeding the compute units. Optimization involves data staging: proactively moving data from global to shared memory before computation, mimicking perfect cache behavior.
AI Workload Patterns & Miss Causes
Neural network execution exhibits specific patterns that challenge caches:
- Large Parameter Tensors: Model weights often exceed cache capacity, leading to capacity misses during layer execution.
- Strided Access Patterns: Convolution operations access input data with large, non-unit strides, harming spatial locality and causing misses.
- Activation Recomputation: Training frameworks may recompute activations to save memory, causing repeated compulsory misses.
- Small Batch Sizes: Inference with batch size 1 provides less data reuse per weight load, increasing miss rates compared to large-batch training.
Optimization Techniques
Reducing cache misses is a key systems optimization:
- Loop Tiling/Blocking: Restructures computation to operate on sub-blocks of data that fit in cache, exploiting temporal locality.
- Data Layout Transformation: Changing the order of tensor dimensions (e.g., NHWC to NCHW) to create contiguous, cache-friendly access patterns.
- Software Prefetching: Inserting explicit instructions to fetch data into cache or shared memory well before it is needed, hiding latency.
- Kernel Fusion: Fusing multiple neural network layers into a single kernel avoids writing intermediate results to memory and reading them back, eliminating those cache accesses entirely.
Related Concepts & Metrics
Understanding cache misses requires knowledge of adjacent concepts:
- Miss Penalty: The extra time taken to service a miss.
- Miss Rate: The fraction of memory accesses that result in a miss.
- Average Memory Access Time (AMAT): Calculated as: Hit Time + (Miss Rate × Miss Penalty). The key formula for quantifying cache performance.
- Working Set: The set of memory addresses a program actively uses in a time window. If it exceeds cache size, capacity misses soar.
- Memory Wall: The growing gap between processor speed and memory latency, making cache miss reduction increasingly critical.
Frequently Asked Questions
A cache miss is a fundamental performance event in computer architecture where requested data is not found in a fast cache, forcing a slower access to main memory. This glossary entry addresses common technical questions about its causes, measurement, and mitigation within NPU and AI accelerator contexts.
A cache miss is an event where a processor or accelerator requests data from a cache and the data is not present, forcing a slower, higher-latency access to a lower level of the memory hierarchy, such as main memory (DRAM) or another processor's cache. This is a primary cause of performance degradation and stalled execution in computing systems. The opposite event, where the requested data is found in the cache, is called a cache hit. The performance of a memory subsystem is often measured by its hit rate (the fraction of accesses that are hits) or its miss rate (the fraction that are misses).
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 in Memory Hierarchy Management
Understanding a cache miss requires knowledge of the surrounding memory system. These related terms define the hierarchy, policies, and access patterns that determine performance.
Memory Hierarchy
A memory hierarchy organizes different memory types (registers, caches, main memory, storage) into a multi-level structure to balance access speed, capacity, and cost. The principle is that smaller, faster memory sits closer to the processor, while larger, slower memory provides bulk storage. A cache miss forces a data request to traverse this hierarchy downward, incurring a significant latency penalty. The hierarchy's effectiveness relies on the principles of temporal and spatial locality in program data access.
Temporal Locality
Temporal locality is the principle that if a memory location is accessed, it is likely to be accessed again in the near future. This is the foundational behavior that makes caches effective. Programs exhibiting strong temporal locality have a low cache miss rate because recently used data remains in the fast cache. Examples include loop counters or frequently called function variables. A cache miss often indicates a breach of expected temporal locality.
Spatial Locality
Spatial locality is the principle that if a memory location is accessed, nearby memory locations are also likely to be accessed soon. This justifies cache designs that fetch data in blocks (cache lines), not just single bytes. When a cache miss occurs due to a lack of spatial locality (e.g., random memory access), the fetched cache line may contain mostly unused data, wasting bandwidth and cache capacity. Optimizing data structures for contiguous access improves spatial locality and reduces miss rates.
Working Set
The working set is the set of memory pages or cache lines a process actively uses within a specific time interval. If the working set size exceeds the available cache capacity, capacity misses occur as the cache cannot hold all required data, leading to constant eviction and reloading. Profiling the working set is critical for sizing on-chip memory (like an NPU's scratchpad or cache) and for optimizing algorithms to have a smaller, more cache-friendly memory footprint.
Prefetching
Prefetching is a hardware or software technique that predicts future memory accesses and proactively loads data into a cache before the processor explicitly requests it. Its goal is to hide memory latency by ensuring data is already present, thereby converting what would be a cache miss into a cache hit. Effective prefetching relies on predictable access patterns (like sequential strides). Incorrect prefetches waste bandwidth and can evict useful data, potentially increasing miss rates.
Memory Access Pattern
A memory access pattern describes the sequence and stride of a program's reads and writes to memory. It is the primary determinant of cache performance. Key patterns include:
- Sequential/Strided: Excellent for prefetching and spatial locality.
- Random: Causes poor cache utilization and high miss rates.
- Gather/Scatter: Common in sparse computations, challenging for caches. Analyzing and optimizing the memory access pattern is a fundamental step in reducing cache misses for NPU kernels and high-performance computing workloads.

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