Performance Debugging through Microarchitectural Sensitivity and Causality Analysis
Alban Dutilleul, Hugo Pompougnac, Nicolas Derumigny, Gabriel Rodrí guez, Valentin Trophime, Christophe Guillon, Fabrice Rastello · 2024
Read Performance Debugging through Microarchitectural Sensitivity and Causality Analysis by Alban Dutilleul, Hugo Pompougnac, Nicolas Derumigny, Gabriel Rodrí guez, Valentin Trophime, Christophe Guillon, Fabrice Rastello (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-13207.txt.
Introduction
Alban Dutilleul and six co-authors wrote a 2024 paper on a tool for debugging the performance of programs on modern processors. Today's out of order chips interleave many parts in complex ways, so slowdowns are hard to trace. Existing tools either watch resource use or model code throughput, and both can mislead.
Their tool takes a resource centric view driven by live instrumentation of the running program. It can detect bottlenecks that arise from hardware and software interacting, not just from a single saturated part. Unlike older approaches, it aims to give causal hints about how to fix a problem, not only facts about where resources run out. The method also travels better across chip designs, since it models resources rather than one fixed layout.
Catalog record
| CREATOR | Alban Dutilleul, Hugo Pompougnac, Nicolas Derumigny, Gabriel Rodrí guez, Valentin Trophime, Christophe Guillon, Fabrice Rastello |
|---|---|
| YEAR | 2024 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 60 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2412-13207
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Performance Debugging through Microarchitectural Sensitivity and Causality Analysis Alban Dutilleul, Hugo Pompougnac, Nicolas Derumigny, Gabriel Rodrí guez, Valentin Trophime, Christophe Guillon, Fabrice Rastello Abstract . Modern Out-of-Order ( OoO ) CPUs are complex systems with many components interleaved in non-trivial ways. Pinpointing performance bottlenecks and understanding the underlying causes of program performance issues are critical tasks to fully exploit the performance offered by hardware resources. Current performance debugging approaches rely either on measuring resource utilization, in order to estimate which parts of a CPU induce performance limitations, or on code-based analysis deriving bottleneck information from capacity/throughput models. These approaches are limited by instrumental and methodological precision, present portability constraints across different microarchitectures, and often offer factual information about resource constraints, but not causal hints about how to solve them. This paper presents a novel performance debugging and analysis tool that implements a resource-centric CPU model driven by dynamic binary instrumentation that is capable of detecting complex bottlenecks caused by an interplay of hardware and software factors. Bottlenecks are detected through sensitivity-based analysis , a sort of model parameterization that uses differential analysis to reveal constrained resources. It also implements a new technique we developed that we call causality analysis , that propagates constraints to pinpoint how each instruction contribute to the overall execution time. To evaluate our analysis tool, we considered the set of high-performance computing kernels obtained by applying a wide range of transformations from the Polybench benchmark suite ( 38 ) and measured the precision on a few Intel CPU and Arm micro-architectures. We also took one of the benchmarks ( correlation ) as an illustrative example to illustrate how our tool’s bottleneck analysis can be used to optimize a code. 1. Introduction In the last decades, high-performance computing has become one of the fundamental pillars of scientific innovation. The end of Dennard scaling in the early 21st century fundamentally shifted the architectural approach to performance improvements, which had been based on increasing clock frequencies with constant MOSFET power densities, and into a “dark silicon” ( 23 ) era in which systems are composed of a heterogeneous collection of computational devices with very different performance-power operating points. While the basics of modern processor designs closely follow the ideas by Robert Tomasulo, debuted in the IBM 360/91 in 1966, CPU cores are nowadays more complex machines. In 2006, Intel launched its "Core" architecture, featuring a 65nm process node, a 4-uops issue width, a 96-entry ROB, and a 32-entry unified schedulers that feeds 6 superscalar ports. In 2023, the Meteor Lake architecture features both performance- and efficient-oriented processors, as well as an integrated GPU. The process node varies for different parts of the chip. The 7nm Redwood Cove P-processor has a 6-uops issue width, with three different instruction-decoding paths, a 512-entry ROB and 3 different scheduling units with a combined 215 entries that feed a 12-port superscalar architecture. Add to the mix Simultaneous Multi-Threading (SMT) support, and the result is an extraordinarily complex architecture, on which performance debugging becomes a daunting task. A popular way to analyze the internal behavior of a CPU for a specific computational kernel is to rely on the performance-monitoring counters (PMCs) made available by the performance-monitoring unit (PMU) of modern CPUs. These model-specific registers provide a native way to measure the frequency of different low-level events in the CPU, offering a glimpse at the internal workings of this otherwise black box. The state-of-the-art Top-down Microarchitecture Analysis (TMA) method ( 46 ) defines a methodology in which low-level events are measured and used to compute aggregation formulas that pinpoint the areas of the processor that become performance bottlenecks during the execution of a given computational kernel. While TMA provides invaluable leads to guide optimization, it has limitations stemming both from precision, methodological, and portability concerns. Binary code analysis ( 2 , 4 , 8 ) is a complementary approach based on a performance model at the assembly level. Although it produces less precise estimations than PMC-based measurements, assembly models a wider range of metrics and greater flexibility in analysis, while not requiring any hardware support. This work proposes two novel performance-debugging methods respectivelly called causality and sensitivity analysis . It is based on a coarse-level model-based simulation, implemented through instrumentation of a binary. This simulation is used to power: (1) a constraints propagation engine, that allows to pinpoint how each individual static instruction contributes to the overall execution time; (2) a differential analysis engine, that studies the performance effects of varying the capacities of different CPU resources, identifying both the CPU functional blocks that act as bottlenecks during the execution of a particular kernel, as well as the bottlenecked sections of code on which to focus the optimization efforts. The contributions of this work are as follows: • A novel causality-based approach to performance debugging which provides information about which specific instruction contribute to the overall execution time. • A novel sensitivity-based approach to performance debugging which provides information about the specific parts of the CPU which limit the performance of a given computational kernel. • An end-to-end implementation of Gus , a sensitivity-based profiler for performance debugging. • An extensive experimental validation over 1624 kernels on 6 different microarchitectures, demonstrating the accuracy of Gus compared to measurements. • A case study illustrating the benefit of our bottleneck analyzer for performance debugging. The paper is organized as follows. Section 2 gives a comprehensive description of existing performance analysis techniques and motivates our approach. Section 3 describes Gus . Section 4 reports our experimental results. Section 5 discussed our implementation choices. Section 6 concludes. 2. Performance debugging: state of the art and motivation Consider the assembly kernel shown in Fig. 1 (a), that yields a raw performance of 12.8 GFLOPS when executed on an Intel i9-12900k core with a theoretical peak performance of 153.6 GFLOPS 1 1 1 This processor features 3xFP-FMA AVX-2 units running at a base frequency of 3.2 GHz. These measurements refer to single-precision FLOPS. . Figuring out where the bottleneck of this computation lies for the given microarchitecture is a remarkably complex task. Here, a bottleneck is defined as a microarchitectural resource or characteristic that becomes a fundamental cause of performance degradation due to the limitations it imposes to the flow of the computation. On the one hand, one could hypothesize that this kernel is memory-bound due to the vmovaps in line 3. However, depending on the access pattern and the prefetcher this load might be served from L1. If so, and depending on the arithmetic intensity of the kernel, the FP FMA units may become saturated and act as the computational bottleneck. This is the fundamental trade-off studied by the Roofline model ( 45 ) , which predicts the expected performance of a kernel from its arithmetic intensity and the architectural parameters of the computer. ⬇ 1 vmovaps (% rcx ),% ymm1 2 for 3 vmovaps (% rax ),% ymm2 4 vfmadd231ps % ymm0 ,% ymm1 ,% ymm3 5 vfmadd231ps % ymm0 ,% ymm1 ,% ymm2 (a) ⬇ 1 vmovaps (% rcx ),% ymm1 2 vmovaps (% rax ),% ymm2 3 for 4 vfmadd231ps % ymm0 ,% ymm1 ,% ymm3 5 vfmadd231ps % ymm0 ,% ymm1 ,% ymm2 (b) Figure 1 .