NUMA Affinity is a kernel-level scheduling constraint that pins a software process or thread to a specific CPU socket and its directly attached local memory banks. In a multi-socket server, accessing memory attached to a remote socket incurs significantly higher latency and lower bandwidth than accessing local memory. By enforcing affinity, the operating system ensures that a model serving process allocates and accesses memory exclusively from the local NUMA node, preventing performance-degrading remote memory fetches during inference.
Glossary
NUMA Affinity

What is NUMA Affinity?
A hardware-aware scheduling policy that binds a process to a specific Non-Uniform Memory Access (NUMA) node to eliminate cross-socket memory access penalties.
For latency-optimized model serving, NUMA affinity is critical to achieving deterministic P99 latency targets. Without it, the OS scheduler may migrate a serving process across sockets, causing unpredictable spikes in memory access time as the process suddenly references remote DRAM. This is enforced using tools like numactl or Linux cgroup cpuset controllers, which constrain the process's CPU and memory allocation to a single node, maximizing local cache hit rates and ensuring consistent, low-latency predictions.
Key Characteristics of NUMA Affinity
NUMA affinity is a critical optimization for latency-sensitive model serving. By binding a process to a specific CPU socket and its directly attached memory, it eliminates the performance penalty of accessing remote memory across the inter-socket interconnect.
Local vs. Remote Memory Access
In a Non-Uniform Memory Access (NUMA) architecture, each CPU socket has its own local memory controller. Accessing local memory offers full bandwidth and minimal latency. Accessing remote memory attached to another socket traverses the inter-socket interconnect (e.g., AMD Infinity Fabric, Intel UPI), introducing a significant latency penalty—often 50-100% higher—and reduced bandwidth. NUMA affinity ensures the process's memory allocations are satisfied from the local node.
First-Touch Memory Allocation Policy
The Linux kernel's default memory policy is first-touch. A physical memory page is allocated on the NUMA node where the CPU first writes to it. To leverage this without explicit membind, an initialization routine can be run on the target NUMA node that sequentially writes to every element of a large tensor. This ensures the data is physically placed in the local memory banks of the socket that will perform the inference, maximizing bandwidth for subsequent reads.
Mitigating Cross-Socket Snooping
Modern CPUs maintain cache coherence across sockets using protocols like MESI. When a process bounces between sockets, it generates excessive cross-socket snoop traffic as the new socket's cache controller must probe the old socket's caches for modified data. This consumes QPI/UPI bandwidth and introduces latency. NUMA pinning eliminates this by ensuring all cache lines are owned and modified within a single socket's coherent domain.
NUMA-Aware Thread Pool Design
For multi-process serving engines like NVIDIA Triton Inference Server, NUMA affinity is applied per model instance. A common pattern is to launch one instance per NUMA node, each bound to its local GPUs and memory. This avoids the catastrophic scenario where a single instance's threads span sockets, causing half of every tensor operation to incur remote memory latency. This design treats each socket as an independent, high-performance compute island.
Performance Impact on Inference
The latency penalty for ignoring NUMA affinity is non-trivial for real-time inference. Benchmarks show that cross-socket memory access can increase P99 latency by 30-60% for large transformer models. This is because the time to load model weights from remote memory dominates the fast matrix multiplication on the local accelerator. For a Service Level Objective (SLO) of 10ms, a 4ms penalty from remote memory access is an unacceptable degradation.
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.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about Non-Uniform Memory Access and its critical role in optimizing high-throughput, low-latency model serving infrastructure.
NUMA affinity is a hardware-aware scheduling policy that pins a specific process or thread to a single CPU socket and its directly attached local memory banks. In a Non-Uniform Memory Access (NUMA) architecture, each CPU socket has its own dedicated memory controller and local RAM. Accessing this local memory is extremely fast, while accessing memory attached to a remote socket requires traversing an inter-socket interconnect, introducing significant latency. NUMA affinity works by leveraging operating system APIs like numactl or libnuma to restrict a process's memory allocation and thread execution to a single NUMA node, ensuring that the vast majority of memory accesses are local. This prevents the operating system scheduler from migrating threads across sockets and forces the memory allocator to prioritize local DIMMs, eliminating the performance penalty of remote memory access.
Related Terms
Core concepts that intersect with NUMA-aware scheduling to minimize cross-socket latency in high-throughput model serving.
CPU Pinning
The practice of binding a process or thread to a specific CPU core using taskset or sched_setaffinity. While NUMA affinity operates at the socket level, CPU pinning provides finer-grained control at the individual core level. Combined, they prevent the OS scheduler from migrating latency-sensitive inference threads across cores or sockets, eliminating cache thrashing and translation lookaside buffer (TLB) invalidation overhead. In Kubernetes, this is configured via the cpuset manager policy in the kubelet.
Non-Uniform Memory Access Architecture
A shared-memory multiprocessor design where each CPU socket has its own local memory bank with lower latency and higher bandwidth than accessing memory attached to a remote socket. On a dual-socket AMD EPYC or Intel Xeon server, a core accessing local DRAM might see ~100ns latency, while cross-socket access can exceed ~300ns. This asymmetry is the root cause of performance variance that NUMA affinity policies seek to eliminate by colocating compute and data.
Single-NUMA-Node Pod Placement
A Kubernetes scheduling constraint ensuring a pod's CPU and memory resources are allocated from a single NUMA node. Configured via the Topology Manager with the single-numa-node policy. This is critical for inference workloads where a model's weights must fit entirely within one socket's local memory. If the Topology Manager cannot satisfy the constraint, the pod is admitted with a TopologyAffinityError rather than silently degrading performance through remote memory access.
Huge Pages
Memory pages larger than the default 4KB, typically 2MB or 1GB, that reduce TLB misses during model inference. When combined with NUMA affinity, huge pages must be pre-allocated on the target NUMA node to prevent the kernel from faulting in pages from a remote socket. The hugetlbfs mount with NUMA awareness ensures that a model's KV cache and weight tensors reside in pinned, physically contiguous local memory, eliminating both TLB miss penalties and cross-socket traffic simultaneously.
Memory Bandwidth Saturation
A condition where all memory channels on a NUMA node are fully utilized, causing queuing delays. In model serving, this occurs when multiple inference replicas on the same socket compete for local DRAM bandwidth. NUMA affinity without replica anti-affinity can inadvertently colocate too many workers on a single node, creating a bottleneck. Monitoring tools like perf stat and Intel PCM expose local_dram vs remote_dram counters to diagnose whether saturation is local or cross-socket induced.

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