NumaPerf: Predictive and Full NUMA Profiling

Xin Zhao, Jin Zhou, Hui Guan, Wei Wang, Xu Liu, Tongping LiuarXiv 2021

Abstract

Non-Uniform Memory Access (NUMA) architectures are standard in modern multi-core systems but present significant performance challenges due to complex memory sharing patterns. NumaPerf is a novel profiling tool that predictively identifies bottlenecks like remote accesses, false sharing, and thread migrations. By focusing on architecture-independent program logic rather than physical hardware data, NumaPerf can detect issues on any machine—even non-NUMA ones—enabling performance speedups of up to 5.94x with manageable overhead.

Introduction

In modern multi-core systems, NUMA is the standard architecture: memory is divided into nodes, and a processor can access its local memory much faster than memory attached to a different node. While this solves scalability issues, it creates a "performance minefield" for developers. Common pitfalls include remote accesses, cache contention (threads fighting over the same cache line), and load imbalance. Existing profiling tools often fall short because they rely on specific hardware topologies, ignore critical issues like thread migration, or fail to provide actionable guidance on how to fix detected bottlenecks.

Methods

NumaPerf breaks away from hardware-dependent profiling by using a "predictive" approach based on program logic. It consists of two main components:

  • NumaPerf-Static: An LLVM-based compiler pass that instruments every memory access to heap and global variables at the intermediate representation (IR) level.
  • NumaPerf-Dynamic: A runtime library that tracks these accesses. Instead of recording physical node IDs, it tracks which thread first "touched" a memory page (the "first-touch" heuristic).
The NumaPerf workflow, illustrating the interaction between static instrumentation and dynamic detection.

Because memory sharing patterns are generally invariant to the program's logic, NumaPerf can use this data to simulate how the program would behave on various NUMA configurations. The tool introduces specific Performance Scores for remote access, sharing, and migration, helping developers prioritize bugs that actually impact execution time.

Key Results

The authors evaluated NumaPerf using standard multi-threaded benchmarks (PARSEC 2.0) and high-performance computing (HPC) applications like AMG2006 and Lulesh.

Detailed breakdown of performance issues identified by NumaPerf and the resulting speedups after applying recommended fixes.

Key findings include:

  • Superior Detection: NumaPerf identified 15 performance bugs that were completely missed by state-of-the-art tools like HPCToolkit and NUMAPROF.
  • Massive Speedups: Fixing the bugs identified led to significant performance gains, most notably a 5.94x speedup for the Lulesh benchmark and a 4.29x speedup for fluidanimate.
  • Efficiency: It operates with a performance overhead of less than 6x. While slower than simple sampling, it is orders of magnitude faster than the 100x–300x overhead typically seen in fine-grained simulators.
  • Actionable Fixes: NumaPerf provides specific guidance, such as distinguishing between False Sharing (fixable via data padding) and True Sharing (requiring algorithmic changes).

Conclusion

NumaPerf demonstrates that logic-based, predictive profiling is a powerful way to optimize for NUMA architectures. While currently limited by source code requirements and specific language support (C/C++), it provides a practical and actionable framework for developers to resolve complex memory bottlenecks without requiring access to high-end server hardware during the initial development phase.

Summary updated

BibTeX
@misc{zhao2021numaperf,
  author = {Xin Zhao and Jin Zhou and Hui Guan and Wei Wang and Xu Liu and Tongping Liu},
  title = {{NumaPerf: Predictive and Full NUMA Profiling}},
  year = {2021},
  eprint = {2102.05204},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.05204},
}
Figure