Abstract
Performance analysis is an important part of the oft-repeated, iterative process of performance tuning during the development of parallel programs. Per-process per-thread traces (detailed logs of events with timestamps) enable in-depth analysis of parallel program execution to identify various kinds of performance issues. Often times, trace collection tools provide a graphical tool to analyze the trace output. However, these GUI-based tools only support specific file formats, are difficult to scale when the data is large, limit data exploration to the implemented graphical views, and do not support automated comparisons of two or more datasets. In this paper, we present a programmatic approach to analyzing parallel execution traces by leveraging pandas, a powerful Python-based data analysis library. We have developed a Python library, Pipit, on top of pandas that can read traces in different file formats (OTF2, HPCToolkit, Projections, Nsight, etc.) and provide a uniform data structure in the form of a pandas DataFrame. Pipit provides operations to aggregate, filter, and transform the events in a trace to present the data in different ways. We also provide several functions to quickly identify performance issues in parallel executions.
Introduction
Performance tuning for high-performance computing (HPC) is often an exercise in frustration. Developers must wade through massive "traces"—detailed logs of every function call and communication event across thousands of processors. Traditionally, this meant using "point-and-click" Graphical User Interfaces (GUIs) like Vampir or Nsight Systems. While visual, these tools are often rigid, don't scale well to massive datasets, and make it nearly impossible to automate the comparison of multiple program runs.
Parallel execution traces are inherently high-dimensional, tracking events across time, processes, threads, and GPUs. Existing GUI-based tools suffer from several bottlenecks: format silos where each tool supports only specific file formats; a lack of reproducibility because analysis is a manual process; scalability issues with millions of events; and the difficulty of comparing multiple runs, which often requires opening separate windows and manual inspection.
Pipit, an open-source Python library, addresses these challenges by moving trace analysis from the mouse to the script. By leveraging the ubiquitous pandas library, Pipit provides a programmatic way to explore, filter, and analyze parallel execution traces with the same ease as a data scientist analyzing a spreadsheet.
Methods: A Unified Data Model for Traces
The core innovation of Pipit is treating parallel traces as a unified pandas DataFrame. This approach enables several key capabilities:
- Unified Data Model: Pipit implements readers for various formats (OTF2, HPCToolkit, Projections, Nsight Systems, etc.) and maps them into a consistent tabular structure.
- Vectorized Operations: By using pandas, Pipit can perform operations—such as calculating the time spent in a function—across millions of rows simultaneously using fast, vectorized C-code.
- Advanced Analysis API: Beyond basic filtering, Pipit provides high-level functions for reconstructing Calling Context Trees (CCT), performing Critical Path Analysis, and detecting patterns like loop iterations by integrating with the
STUMPYlibrary.
Pipit also includes a plotting API built on Bokeh to generate interactive timelines and communication matrices directly within Jupyter notebooks, bridging the gap between scripting and visualization.
Evaluation and Key Results
The authors evaluated Pipit using traces from several real-world HPC applications, including the AMG algebraic multigrid solver, the Laghos hydrodynamics miniapp, and the AxoNN deep learning framework.
Key results from these evaluations include:
- Linear Scalability: Pipit’s core operations, such as the OTF2 reader and communication matrix generation, scale linearly with the number of rows in the trace.
- Parallel Ingestion: By using Python’s multiprocessing, Pipit can read large trace files significantly faster than single-threaded readers.
- Quantifying Overlap: In a case study with AxoNN, Pipit quantified the communication-computation overlap across different code versions—a metric notoriously difficult to extract from standard GUI tools.
Discussion: The Power of Scripting
Pipit demonstrates that scripting can be more effective than GUIs for discovery. Identifying the "top 5 most imbalanced functions" takes just a few lines of Python code, whereas a GUI requires manual sorting and navigation across multiple views. Furthermore, Pipit excels at "scaling studies." A single script can load traces from multiple process counts (e.g., 16 to 256), aggregate their performance, and generate a scaling plot automatically.
However, some challenges remain. Extremely large traces exceeding a single machine's RAM still pose a challenge, though filtering can mitigate this. The authors also aim to expand format support and explore distributed data frames (like Dask) for multi-terabyte traces.
Pipit represents a shift toward "Performance Data Science," applying the same powerful tools used in general data analysis to the world's fastest supercomputers.
Summary updated