Expand description
NUMA-aware memory allocation utilities.
This module provides utilities for NUMA-aware memory allocation, which is critical for optimal performance on multi-socket systems with GPUs. Memory allocated on the NUMA node closest to the target GPU has significantly lower access latency.
§Architecture
NumaNode: Represents a NUMA node IDtopology: Reads CPU-to-NUMA mapping from/sys/devices/system/nodeworker_pool: Dedicated worker threads pinned to specific NUMA nodes
§Usage
NUMA optimization is opt-in via environment variable:
export DYN_KVBM_ENABLE_NUMA=1When enabled, pinned memory allocations are routed through NUMA workers that are pinned to the target GPU’s NUMA node, ensuring first-touch policy places pages on the correct node.
Modules§
- topology
- NUMA topology detection
- worker_
pool - NUMA worker pool for memory allocation with first-touch policy.
Structs§
- Numa
Node - Represents a NUMA node identifier.
Functions§
- get_
current_ cpu_ numa_ node - Get the current CPU’s NUMA node.
- get_
device_ numa_ node - Get NUMA node for a GPU device.
- is_
numa_ enabled - Check if NUMA optimization is enabled via environment variable
- pin_
thread_ to_ numa_ node - Pin the current thread to a specific NUMA node’s CPUs.