Inferensys

Glossary

Non-Uniform Memory Access (NUMA)

Non-Uniform Memory Access (NUMA) is a computer memory design for multiprocessing where memory access time depends on the physical location of the memory relative to the processor.
Developer reviewing multi-agent chat interface on laptop, agent conversation logs visible, casual coding session at WeWork desk.
GPU MEMORY OPTIMIZATION

What is Non-Uniform Memory Access (NUMA)?

Non-Uniform Memory Access (NUMA) is a computer memory design used in multiprocessing where the memory access time depends on the memory location relative to the processor, meaning some regions of memory are faster to access than others from a given CPU core.

Non-Uniform Memory Access (NUMA) is a multiprocessor architecture where memory access latency is not uniform. Each processor, or NUMA node, has its own local memory bank. Accessing this local memory is fast, while accessing memory attached to a remote node incurs higher latency due to interconnects like Intel Ultra Path Interconnect (UPI) or AMD Infinity Fabric. This design contrasts with Uniform Memory Access (UMA) systems, where all processors share a single, centralized memory bus with equal latency. NUMA is fundamental to modern multi-socket servers and high-core-count CPUs.

For GPU memory optimization, NUMA awareness is critical when managing data transfers between host (CPU) and device (GPU) memory. A GPU is typically connected to a specific CPU socket via a PCIe root complex. Allocating host memory from the local NUMA node of that controlling CPU minimizes latency for Direct Memory Access (DMA) transfers and zero-copy operations. Misconfigured NUMA binding can double memory access latency, creating a bottleneck for inference pipelines. System tools like numactl and runtime libraries are used to enforce optimal NUMA affinity for processes and memory allocations.

GPU MEMORY OPTIMIZATION

Key Characteristics of NUMA Architecture

Non-Uniform Memory Access (NUMA) is a memory architecture for multiprocessor systems where memory access time depends on the physical location of the memory relative to the processor. This design fundamentally impacts performance and programming models.

01

Memory Locality and Access Latency

The defining feature of NUMA is non-uniform latency. Each processor or group of processors (a NUMA node) has its own local memory that it can access with low latency. Accessing memory attached to a remote NUMA node (remote memory) incurs significantly higher latency and potentially lower bandwidth due to the need to traverse an interconnect like a crossbar, HyperTransport, or Intel Ultra Path Interconnect (UPI). Optimizing performance requires data locality—keeping data and the threads that process it on the same NUMA node.

02

NUMA Node Topology

A system's NUMA topology maps the physical relationship between processors and memory banks. Key components include:

  • Socket: A physical CPU package, often containing multiple cores.
  • NUMA Node: A logical grouping of cores with a local memory controller and attached RAM. A system can have multiple nodes per socket.
  • Interconnect: The high-speed links (e.g., AMD's Infinity Fabric, Intel's UPI) that connect nodes, enabling remote memory access. Tools like numactl --hardware or lscpu on Linux reveal this topology, which is critical for process and memory pinning.
03

First-Touch Policy and Allocation

Most operating systems (Linux, Windows) use a first-touch policy for memory allocation in NUMA systems. When a process first writes to a page of memory, that page is physically allocated from the local memory of the NUMA node where the writing thread is executing. This policy can lead to suboptimal placement if initialization is done by a single thread, causing all memory to be local to one node while other threads on remote nodes suffer high access latency. Explicit control is achieved via APIs like numactl or libnuma.

04

Impact on GPU Systems and PCIe Placement

NUMA architecture critically affects GPU performance in multi-socket servers. A GPU is physically connected via PCIe to a specific CPU socket (NUMA node). Direct memory access (DMA) transfers between the GPU and local host memory (on the same node) have much higher bandwidth and lower latency than transfers to remote host memory. This makes GPU affinity a key optimization. For optimal GPU Direct Storage or Zero-Copy performance, data buffers must be allocated in the host memory local to the GPU's PCIe root complex.

05

Contrast with UMA (Uniform Memory Access)

NUMA is often contrasted with the older Uniform Memory Access (UMA) architecture, also known as Symmetric Multiprocessing (SMP). In UMA, all processors share a single, centralized memory bus. While all memory has equal access latency for any processor, the shared bus becomes a severe contention bottleneck as processor count increases. NUMA solves this scalability limit by distributing memory controllers, but at the cost of introducing complexity in managing non-uniform latency. Modern multi-socket servers are exclusively NUMA-based.

06

Software Optimization Strategies

Effective use of NUMA requires explicit software strategies:

  • Thread and Memory Pinning: Bind processes/threads to specific cores and allocate memory from the corresponding local node using taskset, numactl, or OpenMP/MPI environment variables.
  • NUMA-Aware Allocators: Use allocators (e.g., tcmalloc, jemalloc) that are aware of NUMA topology to allocate memory from the local node of the requesting thread.
  • Data Partitioning: Design algorithms to partition data structures so that each NUMA node's threads primarily operate on locally allocated memory, minimizing remote accesses.
  • Monitoring: Use performance counters to track NUMA hits/misses and tools like numastat to analyze memory locality.
GPU MEMORY OPTIMIZATION

Why NUMA Matters for AI and Machine Learning

Non-Uniform Memory Access (NUMA) is a critical system architecture concept that directly impacts the performance and cost of large-scale AI inference and training workloads.

Non-Uniform Memory Access (NUMA) is a multiprocessor memory architecture where a processor's access time to memory depends on its physical location, creating local 'fast' memory and remote 'slower' memory. In AI systems, this design is crucial because inefficient data placement across NUMA nodes can introduce significant latency as CPUs or GPUs stall waiting for remote memory fetches. This directly contradicts the low-latency demands of high-throughput inference and parallel training.

For AI workloads, optimal NUMA-aware scheduling binds processes and their memory allocations to the same local node, minimizing costly remote accesses. This is especially vital for data-loading pipelines feeding GPUs and for multi-GPU systems connected via PCIe or NVLink where memory traffic must traverse the NUMA fabric. Proper configuration reduces inference tail latency, improves training iteration times, and maximizes the return on expensive accelerator investments by eliminating unnecessary memory stalls.

MEMORY ARCHITECTURE

NUMA vs. UMA: A Comparison

A comparison of Non-Uniform Memory Access (NUMA) and Uniform Memory Access (UMA) architectures, highlighting their design principles, performance characteristics, and typical use cases in modern computing systems.

FeatureNon-Uniform Memory Access (NUMA)Uniform Memory Memory Access (UMA)

Core Design Principle

Memory access time depends on the physical location of the memory relative to the processor.

All processors share a single, centralized memory bank with uniform access latency.

Memory Organization

Distributed, local memory banks attached to processor nodes via an interconnect.

Centralized, shared memory bus accessible by all processors.

Access Latency Profile

Low latency for local memory; higher, variable latency for remote memory.

Consistent, uniform latency for all memory accesses from any processor.

Scalability

Scales well to high processor counts by distributing memory bandwidth and controllers.

Limited by the bandwidth and contention of the single shared memory bus.

Typical Hardware

Modern multi-socket servers (AMD EPYC, Intel Xeon), high-core-count CPUs.

Traditional symmetric multiprocessing (SMP) systems, simpler multi-core CPUs.

Cache Coherency Protocol

Complex, directory-based or snooping protocols across the interconnect (e.g., AMD Infinity Fabric, Intel QPI/UPI).

Simpler, bus-based snooping protocol.

Software Awareness & Optimization

Requires OS and application awareness (NUMA scheduling, memory placement) for optimal performance.

Transparent to software; no special placement optimizations required.

Primary Advantage

Higher aggregate memory bandwidth and better scalability for data-intensive, parallel workloads.

Simplicity, predictable performance, and ease of programming.

Primary Disadvantage

Performance pitfalls due to non-local memory access; requires careful data locality management.

Memory bandwidth bottleneck and limited scalability as processor count increases.

GPU MEMORY OPTIMIZATION

Frequently Asked Questions

Non-Uniform Memory Access (NUMA) is a critical memory architecture for modern multi-socket servers and high-performance computing systems. Understanding NUMA is essential for optimizing application performance, especially for memory-intensive workloads like machine learning training and large-scale inference.

Non-Uniform Memory Access (NUMA) is a shared-memory multiprocessor architecture where the memory access time depends on the memory location relative to the requesting processor. In a NUMA system, each processor or group of processors (a NUMA node) has its own local memory, which it can access with low latency. Accessing memory attached to a remote NUMA node incurs higher latency and potentially lower bandwidth due to the need to traverse an interconnect like Intel Ultra Path Interconnect (UPI) or AMD Infinity Fabric. The operating system and applications must be NUMA-aware to allocate memory and schedule processes on the node where the required data resides, minimizing these costly remote accesses.

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.