Boosting Performance Optimization with Interactive Data Movement Visualization

Philipp Schaad, Tal Ben-Nun, Torsten Hoefler · DOI

Introduction

In modern High-Performance Computing (HPC), the primary performance bottleneck has shifted from raw computational power to the cost of moving data between memory and the CPU. While processors have advanced significantly, memory latency and bandwidth have not kept pace. Traditionally, developers identify these bottlenecks using profilers such as NVIDIA’s nvprof or Intel’s VTune. However, these tools require running the entire application—which can take hours for complex simulations—and produce dense numerical reports that are difficult to map back to specific source code lines. This creates a slow, frustrating "edit-run-analyze" loop.

To address these challenges, the authors present a Visual Studio Code extension that provides instant, in-situ feedback on a program's dataflow. By visualizing data movement and reuse patterns using static analysis and parameterized simulations, the tool allows developers to identify and fix performance bottlenecks during the coding phase rather than after execution.

Methodology: The Data-Centric Approach

The tool is built upon the DaCe (Data-Centric) framework, which represents programs as Stateful Dataflow Multigraphs (SDFGs). This representation allows for a two-level visualization strategy:

  1. Global View (Coarse-grained): This mode uses static symbolic analysis to calculate logical data volumes and arithmetic intensity (the ratio of math to data movement). This information is overlaid as a heatmap directly onto the program's dataflow graph. Because the analysis is symbolic, users can move sliders to change input parameters—such as matrix sizes—and see how bottlenecks scale instantly.
  2. Local View (Fine-grained): For specific code kernels, the tool runs a small-scale, parameterized simulation. It simulates data access on a simplified hardware model to estimate cache misses (cold and capacity) and visualize spatial and temporal locality.
  3. In-Situ Visualization: Unlike traditional tools that show charts in separate windows, this extension places data directly on the graph nodes and edges. It even visualizes the physical memory layout (e.g., row-major vs. column-major) to show how data elements fit into cache lines, making physical alignment and strides visible to the programmer.

Experimental Evaluation

The tool was evaluated using two real-world HPC applications across three hardware tiers, ranging from consumer-grade Core i9 desktops to the Piz Daint supercomputer (Cray XC50):

  • BERT Encoder: A core component of Transformer-based neural networks, implemented in NumPy.
  • Horizontal Diffusion: A stencil kernel used in weather and climate modeling, sourced from the NPBench suite.

Key Insights and Results

The tool guided the authors to several manual optimizations, such as loop fusion and data reshaping, that yielded massive performance gains:

  • Massive Speedups: For the BERT Encoder, the tool identified unnecessary data movement between loops, achieving speedups between 7.1x and 30.2x compared to the baseline NumPy/MKL implementation. For Horizontal Diffusion, the tool helped achieve a 151.4x speedup on a supercomputer node, outperforming the fastest existing CPU-based NPBench results by 5.7x to 7.2x.
  • Workflow Efficiency: Analysis that previously required minutes or hours of execution time was reduced to a fraction of a second, enabling a truly interactive tuning experience.
  • Attribution Advantage: By mapping performance metrics directly onto the graphical representation of the code, the cognitive load on the engineer is reduced. The tool proves that a "rough" simulation of data access patterns is often sufficient to guide 90% of impactful optimization decisions.

Limitations and Future Work

While powerful, the current approach relies on being able to determine data movement statically or through simple simulation. It struggles with "irregular" programs where data movement depends on runtime values, such as pointer chasing or sparse matrix-vector multiplication with unknown sparsity patterns. Furthermore, the current cache model assumes a fully-associative cache, meaning it cannot yet detect conflict misses.

Future work involves integrating more sophisticated hardware backends to improve the accuracy of the cache model without sacrificing the interactive speed of the visualization.

Summary updated

BibTeX
@inproceedings{schaad2022boosting,
  author = {Philipp Schaad and Tal Ben-Nun and Torsten Hoefler},
  title = {{Boosting Performance Optimization with Interactive Data Movement Visualization}},
  booktitle = {SC},
  year = {2022},
  url = {https://openreview.net/forum?id=f5FkoJGfEz},
}
Figure