Locality Enhancement And Dynamic Optimizations On Multi-Core And Gpu

Zheng ZhangW&M 2012

Abstract

Modern computing efficiency is increasingly defined by the alignment between software execution patterns and underlying hardware architectures. This paper explores the development of programming system supports designed to exploit massive parallelism in GPUs and non-uniform cache sharing in multicore processors. We address two primary performance bottlenecks: control flow divergence and irregular memory references on GPUs, alongside cache contention and missed prefetching opportunities on CPUs. By introducing frameworks such as G-Streamline and G-ADAPT, we demonstrate that software-level transformations—including thread relocation, data relocation, and machine-learning-based adaptive tuning—can significantly enhance performance. Experimental results show speedups of up to 2.8x on GPUs and a 36% performance improvement on multicore CPUs, bridging the gap between hardware potential and software reality.

Introduction

The evolution of modern hardware has introduced a significant complexity gap. While GPUs offer massive SIMD parallelism and multicore CPUs provide complex cache hierarchies, standard programming models often fail to utilize these features efficiently. This mismatch leads to idle computing units and memory bottlenecks. This research focuses on optimizing control flows and memory references at both compilation and execution time to reclaim this lost performance through pure software solutions.

GPU Optimization: Divergence and Irregularity

GPUs rely on Single Instruction Multiple Data (SIMD) execution, where groups of threads (warps) execute the same instruction. When conditional branches cause threads within a warp to follow different paths, "control divergence" occurs, forcing serial execution of paths and idling hardware.

Furthermore, GPU efficiency is highly sensitive to memory access patterns. "Coalesced" access, where threads in a warp access adjacent memory, is ideal. However, "irregular" references (e.g., indirect indexing like A[P[i]]) trigger multiple memory transactions, severely throttling throughput. To combat these, we propose thread and data relocation. By swapping jobs among threads or reordering data in memory, we can ensure that threads within a SIMD group follow the same control path and access memory in a coalesced fashion.

G-Streamline: A Unified Framework

G-Streamline serves as a holistic software solution for dynamic irregularities. It treats control flow and memory access issues simultaneously, resolving potential conflicts between individual optimizations. To mitigate the overhead of dynamic remapping, G-Streamline utilizes a CPU-GPU pipelining scheme. The CPU acts as a background processor, preparing and reordering data for the next chunk of work while the GPU processes the current one, effectively hiding the optimization latency.

Multicore Cache Optimization

On multicore processors, the non-uniform sharing of caches creates complex interactions. Threads may compete for cache space (contention) or benefit from data loaded by others (synergistic prefetching). We conducted a systematic study on how non-uniform shared caches influence contemporary parallel programs. By applying cache-sharing-aware data transformations, we align software data structures with the underlying hierarchy, significantly reducing L2 cache misses and improving execution speed.

Adaptive Tuning with G-ADAPT

The optimal configuration for these optimizations often depends on the specific input data. G-ADAPT addresses this by using machine learning—specifically regression trees—to predict the best parameters (such as thread block size) on the fly. This cross-input adaptive tuning ensures that the system remains efficient across varying workloads without requiring manual intervention.

Key Results

Evaluation across diverse benchmarks (including fluid dynamics, genetic algorithms, and the PARSEC suite) demonstrates the efficacy of these techniques:

  • GPU Speedups: Divergence removal alone provided up to 1.47x speedup, while the unified G-Streamline framework achieved gains up to 2.5x.
  • Multicore Efficiency: Cache-aware transformations improved performance by up to 36% and cut L2 cache misses by half.
  • Predictive Accuracy: G-ADAPT’s predictive model reached 93% accuracy, enabling speedups up to 2.8x compared to manually tuned versions.

Conclusion

By shifting the responsibility of hardware alignment from the programmer to dynamic software frameworks, this work provides a scalable path toward high-efficiency computing. Future work will focus on deeper compiler integration to automate these transformations entirely, further reducing the barrier to high-performance parallel programming.

Summary updated

BibTeX
@inproceedings{zhang2012locality,
  author = {Zheng Zhang},
  title = {{Locality Enhancement And Dynamic Optimizations On Multi-Core And Gpu}},
  booktitle = {W\&M},
  year = {2012},
  doi = {10.21220/s2-arc8-dh10},
}
Figure