Introduction
In high-performance computing (HPC), the integration of CPUs with accelerators like GPUs is essential for achieving peak performance. However, the communication between these components remains a notorious bottleneck. While OpenMP has simplified the process of "offloading" computation to GPUs, managing data flow remains a manual and error-prone task. Programmers often inadvertently introduce inefficiencies, such as transferring redundant data, moving unmodified data back and forth, or allocating device memory that remains unused.
Existing vendor tools provide raw timing and volume data but fail to diagnose why a transfer was inefficient or provide precise source-code attribution. To bridge this gap, we present OMPDataPerf, a low-overhead dynamic analysis tool designed to automatically identify and profile inefficient data movement in heterogeneous OpenMP applications.
System Architecture and Methodology
OMPDataPerf is designed to be compiler- and hardware-agnostic, working across different vendors (NVIDIA, AMD, Intel) without requiring code recompilation for basic profiling. The tool achieves this by utilizing the OpenMP Tools Interface (OMPT) and its External Monitoring Interface (EMI) callbacks.
The core of the tool relies on five key detection algorithms:
- Duplicate Data Transfers: Uses high-speed content-based hashing (
t1ha0_avx2) to detect if identical data is sent to a device multiple times. - Round-Trip Data Transfers: Identifies data sent to a device and returned to the host without any modification.
- Repeated Device Memory Allocations: Tracks variables frequently allocated and deallocated instead of being persisted on the device.
- Unused Device Memory Allocations: Finds GPU memory allocations never accessed by a kernel.
- Unused Data Transfers: Detects data sent to the GPU that is overwritten before it is ever read.
By focusing on the content of the data rather than just memory addresses, OMPDataPerf can identify duplicate data across the system with negligible overhead. Furthermore, it calculates Optimization Potential by subtracting the time spent on identified inefficiencies from the total runtime, providing developers with a predicted speedup for specific code fixes.
Performance Evaluation
We evaluated OMPDataPerf using a diverse set of benchmarks, including the Rodinia Suite, Babelstream, and various HPC workloads like minife, tealeaf, and xsbench. A critical requirement for any dynamic analysis tool is maintaining low runtime overhead to ensure it is practical for production-scale runs.
As shown in the evaluation, OMPDataPerf incurs a geometric-mean runtime overhead of only 5%. This efficiency allows developers to profile complex applications with minimal impact on execution time.
Key Insights and Results
Our evaluation yielded several significant findings:
- Accuracy of Predictions: The tool's "Optimization Potential" predictions were 90% accurate on average when compared to actual speedups achieved after fixing the identified issues.
- Real-World Impact: By following the tool's suggestions, we achieved substantial performance gains, including a 110% speedup in Rodinia’s
bfs, a 14% speedup inbspline-vgh-omp, and a 7% speedup inminife. - Efficiency vs. Correctness: We demonstrated that programs passing all standard correctness checks (e.g., no data races) can still suffer from massive performance inefficiencies. OMPDataPerf fills a vital role that traditional correctness tools miss.
Conclusion and Future Work
OMPDataPerf provides a portable, low-overhead solution for diagnosing data mapping inefficiencies in OpenMP applications. While currently focused on single-GPU configurations, future work will explore multi-GPU scalability and more granular memory access tracking. By providing actionable predictions and precise source-code attribution, OMPDataPerf empowers developers to prioritize optimization efforts where they will have the greatest impact.
Summary updated