Papers
Topics
Authors
Recent
Search
2000 character limit reached

NUMA-Aware Thread Placement

Updated 14 March 2026
  • NUMA-aware thread placement is a set of strategies that aligns computational threads with NUMA memory hierarchies to reduce remote access latency and enhance cache locality.
  • It employs algorithms such as recursive greedy spreading, cost-function models, and heuristic mapping to optimize load balancing, thread migration, and performance.
  • Experimental evaluations demonstrate up to 25% speedup improvements, significant reductions in thread migrations and cache misses, and enhanced stability in multicore environments.

Non-Uniform Memory Access (NUMA)-aware thread placement refers to a collection of strategies, algorithms, and runtime techniques that explicitly align the affinity of computational threads with the physical topology and heterogeneity of memory access latencies in NUMA architectures. As multicore and multisocket systems proliferate, the minimization of costly remote memory accesses and the maximization of cache/memory locality become critical to performance at both the application and system level. This article provides an exhaustive treatment of methodology, system-level abstractions, modeling approaches, scheduling algorithms, experimental evaluations, and implementation insights for NUMA-aware thread placement, as documented in contemporary research.

1. Architectural Motivation and NUMA Topology Abstractions

NUMA systems support multiple processing elements, grouped into nodes each with local memory. Memory access time depends on whether a thread accesses memory local to its node (low latency/bandwidth) or memory remote to another node (higher latency/lower bandwidth). Hardware topology is often described as a graph or hierarchy, with nodes, sockets, cores, and associated interconnect hops—with measured latencies, e.g., T_local ≈ 80–100 ns, T_remote up to 1.4–2× T_local, and bandwidth likewise degrading per hop distance (Tahan, 2014, Rezaei et al., 10 Jun 2025).

Modern NUMA-aware schedulers, such as BubbleSched (0706.2073), represent both threads and hardware as hierarchies:

  • Software abstractions: “Bubbles” are hierarchical groups of threads (OpenMP teams, data-sharing groups), forming a tree structure which reflects data and synchronization affinity.
  • Hardware representation: The system is expressed as a tree of runqueues, mirroring physical processing components: logical CPUs (PEs), cores, chips, nodes, up to the full machine (0706.2073).

NUMA-aware thread placement utilizes this dual-hierarchy to guide mapping, scheduling, and migration decisions throughout the lifetime of parallel computations.

2. Algorithmic Frameworks for NUMA-Aware Placement

A range of algorithmic techniques underpin NUMA-aware thread placement:

  • Recursive greedy spreading (BubbleSched): Entities (threads or bubbles) are recursively assigned to runqueues at each hardware level to minimize the maximum per-node load (makespan), favoring contiguous allocation for high-affinity groups with selective “explosion” (subdivision of bubbles) when required to balance load (0706.2073).
  • Cost-function-driven approaches: Placement is guided by explicit or implicit cost models, typically combining thread load and estimated memory-access penalties:

Costtotal=er[L(e)+α(remote load fraction)]\mathrm{Cost}_{\text{total}} = \sum_{e \to r}[L(e) + \alpha \cdot (\text{remote load fraction})]

or

Leffective(e,r)=L(e)×(1+βDistNUMA(r,homeNUMA(e)))L_\text{effective}(e, r) = L(e) \times (1 + \beta \cdot \text{DistNUMA}(r, \text{homeNUMA}(e)))

with empirically measured remote-access cost factors (e.g., 1.06–1.4×) (0706.2073).

  • Priority-based allocation: At runtime initialization, each core is assigned a priority determined by both direct local capacity and topological proximity to other high-capacity/low-contention cores, favoring placement with highest priority (Tahan, 2014).
  • Heuristic mapping strategies: Static pinning orders such as dense (“fill one socket before next”) and sparse (“spread across sockets round-robin”) are designed to trade off between maximizing cache reuse and memory-controller parallelism (Memarzia et al., 2019, Rezaei et al., 10 Jun 2025).
  • Learning-based decentralized policies: Threads operate as local agents that measure their utility (instructions processed) and perform periodic aspiration learning to decide node migrations, and perturbed learning automata for intra-node core pinning, with provable (Nash) equilibria and guaranteed convergence (Chasparis et al., 2018).
  • Runtime hardware-counter-driven migrations: Migratory schemes (IMAR, IMAR²) use per-thread measurements (GIPS, instructions per byte, memory latency) to continuously optimize placement via performance-score-based ticketed swaps and adaptive rollback (Lorenzo et al., 2018).

3. Placement Models, Performance Metrics, and Predictive Tools

NUMA-aware placement quality can be predicted and quantified using empirical models and performance metrics:

  • Bandwidth modeling: Fractional pattern signatures—static, local, per-thread, and interleaved access—drive matrix-based predictions of bandwidth usage and remote/local traffic for a given thread–memory placement (Goodman et al., 2021). Threads are assigned to sockets such that aggregate memory bandwidth is balanced and remote bottlenecks minimized, with predictions crossed against measured performance (median <2.5% error).
  • Hardware counters: Core performance monitoring units (PMUs), PEBS, and platform-specific APIs (Intel PCM, libnuma) gather measurements of LLC misses, DRAM access counts, instruction throughput, and memory latency, all of which factor into placement decisions (Rezaei et al., 10 Jun 2025, Lorenzo et al., 2018, Siavashi et al., 15 Feb 2025).
  • Aggregate utility functions: Placement decisions are often reduced to the maximization of per-thread or per-process utility scores, such as:

Pijk=GIPSijkβinstBijkγlatencyijkαP_{ijk} = \frac{\mathrm{GIPS}_{ijk}^\beta \cdot \mathrm{instB}_{ijk}^\gamma}{\mathrm{latency}_{ijk}^\alpha}

or the sum of completed instructions per second (Chasparis et al., 2018, Lorenzo et al., 2018).

  • Quality of Service (QoS) controls: Some systems additionally monitor and enforce per-node bandwidth limits to prevent outlier-induced degradation, dynamically throttling adversarial workloads using mechanisms such as Intel RDT/MBA (Siavashi et al., 15 Feb 2025).

4. Integration with Parallel Runtimes, OS, and Virtualized Environments

NUMA-aware thread placement is realized through a combination of operating system interfaces, parallel runtime extensions, and, in virtualized settings, orchestration layers:

  • OpenMP runtime integration: Modern runtimes (e.g., NANOS, Marcel/BubbleSched, GOMP) align OpenMP teams or nested parallel regions with bubbles, mapping teams to hardware hierarchies, and incorporating NUMA-aware task stealing, work balancers, or recursive placement (0706.2073, Tahan, 2014).
  • OS and kernel-level mechanisms: pthread_setaffinity_np, sched_setaffinity, mbind, and numactl provide core/memory binding; page-table placement and dynamic replication is implemented in kernel modules (e.g., Phoenix), leveraging hooks for task creation, context switch, and PMU sampling (Siavashi et al., 15 Feb 2025).
  • Virtualized and disaggregated setups: Algorithmic controllers map virtual CPUs (vCPUs) to physical cores using interference-class compatibility matrices, benefit tables, performance-deviation thresholds, and run-time performance polling through libvirt and perf. The mapping is kept static unless deviations in achieved performance trigger migration (“reshuffles”) (Lakew et al., 2 Jan 2025).
Abstraction Example Implementation Reference
Scheduler Hierarchy BubbleSched/Marcel (0706.2073)
Learning Agents Decentralized pinning (Chasparis et al., 2018)
OS Pinning pthread_setaffinity_np (Memarzia et al., 2019)
Kernel Module Phoenix (LKM for Linux) (Siavashi et al., 15 Feb 2025)
Virtualization Ctrl. KVM/libvirt controller (Lakew et al., 2 Jan 2025)

5. Quantitative Impact, Comparative Evaluation, and Limitations

Experimental findings consistently report substantial gains from NUMA-aware thread placement in load-balanced, memory-intensive, or synchronization-heavy workloads:

  • Speedup improvement: Up to 25% over OS/default OpenMP on 16-core NUMA systems (0706.2073); 2× over baseline for task-heavy applications; up to 33–241× in disaggregated/virtualized multi-level NUMA systems relative to unpinned Linux/KVM (Lakew et al., 2 Jan 2025). On quantum simulation workloads, explicit pinning and buffer-split yield additional 10–15% throughput over simple NUMA allocation alone (Rezaei et al., 10 Jun 2025).
  • Locality/cost metrics: Pinning reduces thread migrations by >99.95%, LLC misses by 33%, and remote memory accesses by 32% (Memarzia et al., 2019). Ticketed migration (IMAR²) regains 60–70% of lost performance in pathological placements (Lorenzo et al., 2018).
  • Stability: Affinity-based mappings exhibit low runtime variance (run-to-run CoV <0.04), compared to high variance for default scheduler (CoV >0.4) (Lakew et al., 2 Jan 2025).
  • Overheads: Learning-based and hardware-counter-driven approaches demonstrate negligible runtime and memory overhead compared to their performance benefit, provided migrations and sampling intervals are judiciously tuned.
  • Best practices: Static pinning is effective for memory-bound workloads; “spread” topologies are preferred for maximizing aggregate bandwidth when applications use fewer threads than hardware cores (Memarzia et al., 2019).

A plausible implication is that, except for very idle systems (where the OS scheduler may suffice), explicit NUMA-aware control is beneficial across scientific, data analytics, and cloud/server workloads. Limitations include minor perturbation of well-balanced codes during initial exploration (Lorenzo et al., 2018) and the need for manual customization of affinity policies or benefit matrices in highly heterogeneous or multi-tenant configurations.

6. Advanced and Integrated Approaches

Emerging strategies extend NUMA-aware thread placement with synergistic components:

  • Joint thread/data/page-table placement: Phoenix introduces coordinated scheduling of both computation threads and page table replica allocation, with triggers based on observed PMU events (page-walk cycles/total cycles) and adaptive on-demand replication or migration (Siavashi et al., 15 Feb 2025). This joint model is formalized as a total cost minimization:

F=tT[LlocalAlocal(t,nt)+LremoteAremote(t,nt)]+F = \sum_{t \in T} [L_\text{local} A_\text{local}(t, n_t) + L_\text{remote} A_\text{remote}(t, n_t)] + \ldots

where \ldots includes thread-, page-table-migration, and replication costs.

  • NUMA-aware resource allocation in disaggregated and virtualized systems: Workloads are dynamically classified (e.g., Sheep, Rabbit, Devil interference classes), and pinning/migration decisions are triggered by hardware counter deviation while honoring inter-class compatibility matrices. Continuous benefit-matrix learning refines the mapping in response to empirical observations, enabling scalable operation on 288-core (6-server) disaggregated clusters (Lakew et al., 2 Jan 2025).
  • Memory-bandwidth management: Integrated control of memory bandwidth per NUMA node, with provisioning for Quality of Service, prevents interference among colocated processes—especially in cloud server scenarios (Siavashi et al., 15 Feb 2025).

This trend toward highly integrated, feedback-driven placement policies underscores the necessity of NUMA-awareness across scheduler, memory manager, and I/O subsystems in modern high-concurrency computing environments.

7. Recommendations and Future Directions

Current research and experimental practice suggest several universally applicable guidelines:

  • Always detect the NUMA topology and enumerate local vs. remote nodes/cores at runtime.
  • Use static thread pinning for predictable, memory-intensive parallel workloads; prefer spread/topology-aware mapping when aggregate memory bandwidth is paramount.
  • Integrate first-touch memory allocation with the binding policies, ensuring pages are faulted on the intended node.
  • In virtualized or disaggregated systems, use runtime performance counters (IPC, MPI) as direct triggers for mapping corrections.
  • Employ learning-based adaptive placement (local aspiration, stochastic migration) under dynamic or semi-predictable workload patterns.
  • Augment thread-centric policies with explicit coordination for data and page-table placement, especially for workloads characterized by frequent TLB misses or high synchronization (Siavashi et al., 15 Feb 2025).
  • Continuously monitor and control per-node bandwidth to enforce workload QoS where possible.

The ongoing challenge remains to maintain NUMA-awareness in the face of greater heterogeneity (different server classes, deeper memory hierarchies, systems-on-chip with layered caching), increased virtualization, and dynamic, multi-tenant workloads. Future research directions are likely to focus on global coordination of placement policies, cross-layer cost modeling, and fully autonomous placement agents informed by continuously evolving workload and hardware telemetry.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to NUMA-aware Thread Placement.