TL;DR
This paper introduces HPAC-Offload, a novel programming model that extends OpenMP offload to enable portable approximate computing (AC) on GPUs. By adapting existing AC techniques to GPU architectures, HPAC-Offload significantly accelerates HPC applications with minimal impact on accuracy, offering a path to overcome performance limitations in modern computing.
What Problem Does This Paper Address?
The slowdown of Moore's Law and Dennard scaling has pushed High-Performance Computing (HPC) towards parallel architectures, with GPUs becoming dominant. To maintain performance gains, HPC needs new paradigms, and Approximate Computing (AC) offers a solution by trading a small loss in accuracy for significant performance improvements. However, existing AC techniques have not been thoroughly evaluated or adapted for GPUs, which have unique architectural characteristics (massive parallelism, memory hierarchy, SIMD execution) that can hinder traditional AC approaches. This paper addresses this gap by developing and evaluating a GPU-aware AC framework.
Methods
The core contribution is HPAC-Offload, a pragma-based programming model that extends the portable OpenMP offload standard. It allows developers to annotate code regions for approximation using familiar idioms. Key aspects include:
- GPU-Aware AC Design: HPAC-Offload rethinks AC for GPUs by:
- GPU Memory Design: Storing AC internal state (like memoization tables) in shared memory to reduce global memory traffic and resource consumption, leveraging the GPU's hierarchical memory.
- Prescriptive and Hierarchical GPU AC: Introducing hierarchy levels (thread, warp, block) for approximation decisions, allowing groups of threads to collectively decide whether to approximate, mitigating thread divergence.
- Adapted AC Techniques: The framework adapts state-of-the-art software AC techniques:
- Temporal Approximate Function Memoization (TAF): Modified to relax spatial locality assumptions, enabling independent thread management of TAF state and avoiding serialization.
- Input Approximate Function Memoization (iACT): Adapted to share memoization tables within a warp to reduce memory overhead, with configurable table sharing to balance memory use and synchronization.
- GPU-Aware Loop Perforation: Introduces "herded perforation" where entire warps skip the same iterations to prevent thread divergence and maintain uniform control flow.
- Implementation: The framework is implemented in Clang/LLVM and uses OpenMP offload device functions for portability.
Datasets
The paper evaluates HPAC-Offload on a suite of proxy apps, mini-apps, and benchmarks from HPC and machine learning. These include:
- LULESH
- Leukocyte
- Binomial Options
- MiniFE
- Blackscholes
- LavaMD
- K-Means
No new benchmarks were introduced; the focus was on adapting existing ones.
Key Insights and Ideas
- GPU AC is Viable and Beneficial: State-of-the-art AC techniques, when properly adapted, can significantly boost performance on GPUs for HPC applications.
- Trade-offs are Crucial: Approximation inherently involves a trade-off between performance gains and accuracy loss. The optimal balance is application-specific and depends on factors like the number of threads, available parallelism, and the nature of the computation.
- Hierarchy Matters for GPUs: Thread divergence is a major challenge for AC on GPUs. Hierarchical decision-making (warp/block level) is crucial for mitigating this and improving performance.
- TAF Outperforms iACT in Speed: TAF generally achieves higher speedups than iACT, likely because it can amortize decision-making costs by approximating multiple times, whereas iACT always incurs the cost of checking for input matches.
- RSD Behavior is Unpredictable: The Relative Standard Deviation (RSD) metric used in TAF can lead to unintuitive results and interactions with application logic, highlighting the need for careful parameter tuning and understanding.
- Parallelism vs. Approximation: There's a delicate balance between maximizing GPU parallelism (more threads) and maximizing approximation potential (fewer threads executing more work).
Key Results
- Significant Speedups: HPAC-Offload achieves speedups of up to 6.9x across evaluated applications, with a geometric mean speedup of 1.42x.
- Minimal Quality Loss: The introduced error is generally very low, often less than 10% MAPE, and in many cases much lower (e.g., 0.1% for LavaMD, 0.67% for LULESH with TAF).
- Application-Specific Performance:
- LULESH: Up to 1.67x speedup with <7% MAPE.
- Binomial Options: Up to 6.90x speedup with 1.40% MAPE (TAF on NVIDIA).
- Leukocyte: Up to 1.99x speedup with 1.12% error (TAF).
- Blackscholes: Up to 2.26x speedup on AMD with 0.015% MAPE.
- LavaMD: Up to 2.98x speedup with 0.133% error (TAF).
- Portability: The framework was evaluated on both NVIDIA (Tesla V100) and AMD (Instinct MI250x) GPUs.
Limitations and Future Work
- Parameter Space Exploration: The paper acknowledges the large parameter space for AC techniques, which requires significant compute time for exhaustive search. Automating this workflow with sensitivity analysis and optimization techniques is suggested for future work.
- Code Region Sensitivity: The effectiveness of AC is highly dependent on the specific code region and input data. The current work studies methods for porting AC but doesn't fully automate the identification of optimal regions or data.
- Hardware Support for iACT: The authors suggest that hardware support for approximate memoization tables could significantly improve iACT's performance.
- Dynamic Shared Memory: The implementation relies on static shared memory allocation, which might be improved with full dynamic shared memory support in the LLVM OpenMP implementation.
Summary updated