Inferensys

Glossary

GPU Page Faults

A GPU page fault is an exception raised when a GPU attempts to access a virtual memory address that is not currently resident in its physical memory, triggering the memory management unit to migrate the required page from a backing store.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
GPU MEMORY OPTIMIZATION

What is GPU Page Faults?

A GPU page fault is a core mechanism in unified memory systems that enables efficient memory oversubscription by triggering on-demand data transfers.

A GPU page fault is an exception raised when a GPU attempts to access a virtual memory address whose corresponding data page is not resident in its physical device memory. This triggers the memory management unit (MMU) to locate the page—typically in host RAM or storage—and migrate it into GPU memory via demand paging. This mechanism is foundational for Unified Virtual Memory (UVM) architectures, allowing applications to transparently oversubscribe GPU memory capacity.

Handling page faults incurs a performance penalty due to the latency of the page migration from a slower backing store. Optimization involves minimizing fault frequency through memory access pattern tuning and prefetching. In inference workloads, excessive page faults directly increase latency and reduce throughput, making their management critical for cost-effective, high-performance deployment of large models that exceed local GPU memory.

GPU MEMORY OPTIMIZATION

Key Characteristics of GPU Page Faults

GPU page faults are a core mechanism of unified memory systems, enabling memory oversubscription and efficient data movement. Understanding their triggers and handling is essential for optimizing performance in memory-constrained environments.

01

The Fault Trigger

A GPU page fault is an exception raised by the Memory Management Unit (MMU) when a GPU thread attempts to access a virtual memory address whose corresponding physical page is not resident in GPU memory. This occurs under Unified Virtual Memory (UVM) or demand paging schemes when the required data resides in host memory or on storage (e.g., NVMe SSD). The fault pauses the thread and initiates a page migration.

02

Fault Resolution & Page Migration

Upon a fault, the system's page fault handler is invoked. It orchestrates the migration of the required 4KB (or larger huge page) from its current location (CPU memory or storage) into GPU memory. For GPU Direct Storage (GDS), this can be a direct transfer from NVMe to GPU memory, bypassing the CPU. The resolving thread is stalled until migration completes, creating latency. This process is the foundation of memory overcommit.

03

Performance Impact: Latency vs. Capacity

Page faults introduce non-deterministic, high latency—orders of magnitude slower than a GPU memory hit (microseconds to milliseconds vs. nanoseconds). This trade-off enables oversubscription, allowing workloads to use more aggregate memory than physically available on the GPU. Performance hinges on locality: frequent faults on hot pages cause thrashing, while infrequent faults on cold data are an acceptable cost for increased capacity.

04

Major vs. Minor Faults

  • Major Fault (Hard Fault): Occurs when the required page is not in any physical RAM (GPU or CPU) and must be read from disk/storage. This has the highest latency.
  • Minor Fault (Soft Fault): Occurs when the page is resident in host (CPU) memory but not in GPU memory. Resolution involves a DMA transfer over PCIe or NVLink, which is faster than disk I/O but still significant. Understanding this distinction is key for profiling and optimizing data placement.
05

Prefetching & Hints

To mitigate fault latency, systems use prefetching. The programmer or a runtime can issue prefetch hints (e.g., cudaMemPrefetchAsync) to migrate data to the GPU before it is accessed, converting a future fault into a background transfer. Advanced systems employ access pattern predictors to automate prefetching. Stream-ordered memory allocators also integrate with this mechanism for efficient memory reuse.

06

Interaction with Memory Hierarchy

Page faults operate within a broader memory hierarchy and tiering strategy. Data can reside in:

  • GPU HBM/Global Memory (fastest)
  • CPU DDR Memory (slower, accessed via PCIe)
  • NVMe Storage (slowest, accessed via GDS) Faults trigger demotion/promotion between these tiers. Page-locked (pinned) host memory is often used as a staging area to accelerate minor faults. Effective use of huge pages can reduce fault frequency by covering larger address ranges per page table entry.
PERFORMANCE IMPACT AND OPTIMIZATION

GPU Page Faults

A GPU page fault is a critical performance event in unified memory systems that directly impacts inference latency and throughput.

A GPU page fault is an exception raised when a GPU attempts to access a virtual memory address whose corresponding physical page is not resident in its high-speed memory (e.g., HBM). This triggers the memory management unit (MMU) to locate and migrate the required data page from a slower backing store, such as host RAM or storage, causing significant latency. In inference workloads, frequent faults degrade throughput and increase tail latency, as the GPU pipeline stalls waiting for data.

Optimization focuses on minimizing fault frequency through demand paging strategies, prefetching algorithms, and efficient memory pool allocation to promote data locality. Techniques like unified virtual memory (UVM) with peer-to-peer access and GPU Direct Storage aim to reduce migration overhead. For system architects, managing page fault behavior is essential for controlling inference cost and achieving predictable performance in memory-oversubscribed environments.

GPU PAGE FAULTS

Frequently Asked Questions

A GPU page fault is a core mechanism of modern virtual memory systems for accelerators. It occurs when a GPU kernel attempts to access a memory address that is not currently resident in the GPU's physical memory (e.g., HBM). This triggers the GPU's Memory Management Unit (MMU) to locate and migrate the required data, enabling techniques like memory overcommit and demand paging. Understanding page faults is critical for systems engineers optimizing memory-bound workloads and managing large models.

A GPU page fault is an exception raised by the GPU's Memory Management Unit (MMU) when a running kernel attempts to access a virtual memory address whose corresponding physical memory page is not currently resident in the GPU's device memory (e.g., HBM or GDDR). This is not an error but a fundamental mechanism of Unified Virtual Memory (UVM) systems. The fault pauses the offending thread, triggers a page migration from a backing store (like host RAM or SSD), and then resumes execution once the data is locally available. This enables memory overcommit, allowing workloads to use more virtual address space than there is physical GPU memory.

Prasad Kumkar

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.