NUMA Alignment is the practice of co-locating a process's compute threads and its allocated memory within a single Non-Uniform Memory Access (NUMA) node. In multi-socket server architectures, each CPU socket has its own local memory controller and directly attached DRAM. Accessing memory attached to a remote socket incurs significantly higher latency and reduced bandwidth compared to local access. Alignment enforces a strict affinity policy, preventing the operating system scheduler from migrating threads or memory pages across the NUMA interconnect.
Glossary
NUMA Alignment

What is NUMA Alignment?
NUMA Alignment is a system optimization technique that binds a workload's CPU threads and memory allocations to the same physical Non-Uniform Memory Access node, minimizing remote memory access latency for latency-sensitive processes like GPU-attached host services.
This optimization is critical for GPU-attached host processes, such as NVIDIA's GPU Direct memory pinning agents or data loading pipelines. If a CPU core on socket 0 is managing a GPU on the PCIe bus attached to socket 0, but its working memory is allocated on socket 1, every data transfer traverses the inter-socket UPI or Infinity Fabric link. This introduces jitter and bottlenecks the GPU's data ingestion rate, starving the accelerator. Proper alignment ensures the entire data path—from storage to CPU memory to GPU—remains localized.
Key Characteristics of NUMA Alignment
NUMA alignment is a critical performance optimization for GPU-attached host processes. By binding CPU threads and their memory allocations to the same NUMA node, systems eliminate cross-node memory access penalties that can devastate throughput in latency-sensitive AI workloads.
The Remote Access Penalty
In a Non-Uniform Memory Access architecture, each CPU socket owns local memory banks. Accessing local memory occurs at full speed, but accessing remote memory attached to another socket incurs a significant latency penalty—often 50-100% slower. For GPU-attached processes like data loaders or inference preprocessors, a thread running on socket 0 but accessing memory allocated on socket 1 forces every read across the inter-socket interconnect (UPI/Infinity Fabric) , creating a bottleneck that starves the GPU of data.
GPU-NUMA Topology Discovery
Determining which NUMA node a GPU is attached to requires querying the system's PCIe topology. The command nvidia-smi topo -m displays the affinity matrix between GPUs, NICs, and NUMA nodes. A GPU connected via the CPU's integrated PCIe controller will show PIX (PCIe internal) affinity to its local NUMA node. Misalignment occurs when a workload's CPU threads are scheduled on a different NUMA node than the GPU's attached node, forcing all GPU Direct RDMA transfers and command submissions to traverse the inter-socket link.
Automatic NUMA Balancing Pitfalls
Linux kernels with automatic NUMA balancing enabled attempt to migrate pages closer to accessing threads. However, for GPU workloads, this can be actively harmful:
- The kernel may migrate memory pages to a remote node based on transient access patterns
- GPU-driven DMA transfers are invisible to the CPU's page access tracking
- Balancing scans consume CPU cycles and memory bandwidth
Best practice is to disable automatic NUMA balancing (echo 0 > /proc/sys/kernel/numa_balancing) on GPU compute nodes and rely on explicit numactl binding.
Multi-GPU Alignment Strategy
In multi-GPU systems, each GPU should be paired with a dedicated CPU process bound to its local NUMA node. Common patterns include:
- One process per GPU: Launch N processes, each bound with
numactl --cpunodebind=X --membind=Xwhere X matches the GPU's NUMA node - Thread affinity within a process: Use
pthread_setaffinity_np()ortasksetto pin specific threads to cores on the correct node - CUDA IPC and NUMA: When using CUDA Inter-Process Communication for multi-GPU sharing, ensure the producer and consumer processes reside on the same NUMA node to avoid inter-socket IPC overhead
Memory Allocation Policy Enforcement
Beyond numactl, applications can enforce alignment programmatically:
libnumaAPI: Providesnuma_alloc_onnode()andnuma_run_on_node()for fine-grained control- CUDA managed memory:
cudaMallocManaged()withcudaMemAdviseSetPreferredLocationcan hint the GPU's local NUMA node - Huge pages: Combining NUMA binding with 1GB huge pages (
hugetlbfs) ensures large contiguous memory regions stay local, reducing TLB misses during high-throughput GPU data transfers
Failure to align huge pages results in the same remote access penalty amplified across larger memory regions.
Frequently Asked Questions
Clear, technical answers to the most common questions about Non-Uniform Memory Access optimization for GPU-accelerated workloads.
NUMA alignment is the practice of binding a workload's CPU threads and memory allocations to the same physical Non-Uniform Memory Access node to minimize cross-node memory access latency. In a multi-socket server, each CPU socket has its own local memory controller and directly attached DRAM, forming a NUMA node. When a process running on CPU core 0 accesses memory allocated on the DIMMs attached to CPU socket 1, the data must traverse the inter-socket interconnect (e.g., Intel UPI or AMD Infinity Fabric), incurring 1.5x to 2x higher latency and reduced bandwidth compared to local access. NUMA alignment works by using operating system APIs like numactl or libnuma to explicitly pin processes to specific cores and allocate memory from the local node, ensuring the CPU-to-memory path remains on-die. For GPU-attached host processes, this is critical because the CPU must efficiently stage data and issue commands to the GPU over PCIe, and any NUMA-induced latency jitter directly degrades inference and training throughput.
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
Mastering NUMA alignment requires understanding the adjacent technologies and scheduling primitives that govern memory locality in multi-socket GPU servers.
Memory Interleaving
A BIOS-configurable NUMA memory policy that distributes memory allocations in a round-robin fashion across all NUMA nodes. While memory interleaving increases average latency, it prevents bandwidth saturation on a single memory controller.
- Contrasts with NUMA alignment's goal of strict locality
- Useful when a workload's memory access pattern is unpredictable or uniformly distributed
- Often disabled for GPU servers to enforce explicit
numactl-based locality control
PCIe Topology Awareness
The practice of mapping the physical PCIe bus hierarchy to NUMA domains to ensure GPU accelerators are used by CPUs on the same socket. PCIe topology awareness requires understanding which root complex a GPU is attached to.
lspci -vtdisplays the tree of PCIe bridges and devices- NVIDIA's
nvidia-smi topo -mshows the NUMA affinity of each GPU - Misalignment forces GPU DMA transfers to traverse the inter-socket QPI/UPI link, introducing latency and bandwidth bottlenecks

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