Abstract
Automatic performance debugging of parallel applications usually involves two steps: automatic detection of performance bottlenecks and uncovering their root causes for performance optimization. Previous work fails to resolve this challenging issue in several ways: first, several previous efforts automate analysis processes, but present the results in a confined way that only identifies performance problems with apriori knowledge; second, several tools take exploratory or confirmatory data analysis to automatically discover relevant performance data relationships. However, these efforts do not focus on locating performance bottlenecks or uncovering their root causes. In this paper, we design and implement an innovative system, AutoAnalyzer, to automatically debug the performance problems of single program multi-data (SPMD) parallel programs. Our system is unique in terms of two dimensions: first, without any apriori knowledge, we automatically locate bottlenecks and uncover their root causes for performance optimization; second, our method is lightweight in terms of size of collected and analyzed performance data. Our contribution is three-fold. First, we propose a set of simple performance metrics to represent behavior of different processes of parallel programs, and present two effective clustering and searching algorithms to locate bottlenecks. Second, we propose to use the rough set algorithm to automatically uncover the root causes of bottlenecks. Third, we design and implement the AutoAnalyzer system, and use two production applications to verify the effectiveness and correctness of our methods. According to the analysis results of AutoAnalyzer, we optimize two parallel programs with performance improvements by minimally 20% and maximally 170%.
Introduction
Optimizing parallel programs is notoriously difficult. Even for experts, sifting through mountains of performance data—metrics, traces, and logs—to find out why a program is slow feels like finding a needle in a haystack. Existing tools generally fall into two camps: manual tools that require expert interpretation, and pattern-matching tools that only identify pre-defined "bad patterns."
AutoAnalyzer is an automated, lightweight system designed to find and fix performance bottlenecks in SPMD (Single Program Multiple Data) parallel programs. By combining clustering algorithms with "rough set" data mining, it identifies both load imbalances and local code inefficiencies—and their root causes—without requiring any prior knowledge of the program's behavior.
System Architecture and Methodology
The AutoAnalyzer system follows a structured three-step workflow to move from raw source code to actionable performance insights.
1. Automatic Instrumentation
Using a source-to-source compiler, the tool automatically divides the program into "code regions" (functions, loops, etc.) and inserts probes. This ensures that performance data is captured at a granular level relevant to the developer.
2. Bottleneck Detection
AutoAnalyzer distinguishes between two types of performance issues:
- External Bottlenecks (e.g., Load Imbalance): The system uses the OPTICS clustering algorithm. It treats each process's performance as a vector. If processes do not cluster together, it indicates a discrepancy in behavior, signaling a bottleneck like load imbalance.
- Internal Bottlenecks (e.g., Poor Cache Usage): The system uses k-means clustering based on a new metric called CRNM (Code Region Normalized Metric). This metric balances the "importance" of a code region (execution time) with its "efficiency" (cycles per instruction).
3. Root Cause Analysis
This is the most novel component of the system. The authors utilize the Rough Set algorithm and discernibility matrices. By comparing "healthy" regions or processes with "bottleneck" ones across various hardware counters (L1/L2 cache misses, I/O, etc.), the algorithm extracts the "core" attributes—the specific metrics that are the primary drivers of the slowdown.
Key Insights: Dissimilarity and Rough Sets
A core philosophy of AutoAnalyzer is using dissimilarity as a signal. Instead of looking for "known bad" patterns, the system looks for statistical outliers. If one process behaves differently than others in an SPMD program, it is likely a bottleneck.
Furthermore, by using Rough Set theory, the authors can mathematically prove which hardware metrics are the most "discernible" factors causing a bottleneck. This removes the guesswork for the developer, providing a clear target for optimization. The tool is also designed to be lightweight, requiring only about 125 bytes of data per region per process, which minimizes the "probe effect" where the measurement tool itself slows down the application.
Experimental Results
The authors evaluated AutoAnalyzer using two real-world production applications: ST (a seismic tomography application) and NPAR1WAY (a module from the SAS statistical software suite).
- ST Application: AutoAnalyzer identified a load imbalance and high L2 cache misses. Implementing dynamic workload dispatching and loop restructuring based on these hints led to a 170% performance improvement.
- NPAR1WAY Application: The tool identified redundant common expressions in deep loops. Fixing these led to a 20% performance boost.
In the ST case, an MS student was able to locate and fix the bottlenecks in just two days using the tool's output—a task that might otherwise take weeks of manual profiling.
Conclusion and Future Work
AutoAnalyzer demonstrates that automated, lightweight analysis can lead to significant real-world performance gains without requiring expert-level manual debugging. While currently tailored for SPMD programs, future work aims to extend these clustering and rough set methods to more generalized, heterogeneous parallel models. Additionally, the team plans to further streamline the integration of source-to-source transformation into complex build environments.
Summary updated