CPU and/or GPU: Revisiting the GPU Vs. CPU Myth

Kishore Kothapalli, Dip Sankar Banerjee, P. J. Narayanan, Surinder Sood, Aman Kumar Bahl, Shashank Sharma, Shrenik Lad, Krishna Kumar Singh, Kiran Kumar Matam, Sivaramakrishna Bharadwaj, Rohit Nigam, Parikshit Sakurikar, Aditya Deshpande, Ishan Misra, Siddharth Choudhary, Shubham GuptaarXiv 2013

Beyond the "Either-Or" Mentality

In the modern era of accelerator-based computing, the CPU is frequently relegated to a secondary role, acting merely as a manager that offloads data to the GPU and remains idle while waiting for results. This has fostered a persistent "myth" in high-performance computing: that one must choose between a CPU or a GPU for a specific task.

This paper challenges that rivalry, arguing that leaving multi-core CPUs idle during heavy computation is a waste of valuable resources. Instead, the authors propose a hybrid computing model where both processors work in tandem. By leveraging the unique architectural strengths of both multicore CPUs and many-core GPUs simultaneously, they demonstrate significant improvements in performance and resource efficiency.

Comparison of Pure Device (GPU-only) execution versus the proposed Hybrid model.

Algorithmic Strategies for Hybrid Computing

To effectively partition workloads, the authors developed two primary strategies:

  1. Work Sharing: This approach decomposes a problem into data segments, distributing them between the CPU and GPU. For instance, in Sparse Matrix-Vector Multiplication (SpMV), dense rows are assigned to the GPU (which excels at regular patterns), while sparse rows are handled by the CPU (which is better equipped for irregular memory access).
  2. Task Parallelism: This strategy treats computation as a graph of interdependent tasks, mapping specific functions to the processor best suited for them. In Bilateral Filtering, the CPU precomputes expensive transcendental functions into look-up tables, which the GPU then utilizes to process pixels.

These strategies were implemented using OpenMP for CPU multithreading and CUDA for GPU acceleration, with a focus on minimizing the "idle time" of both processors.

Diverse Workloads and Methodology

The study evaluated 13 diverse workloads across various application areas, from image processing to computational finance. These workloads were chosen to represent a wide spectrum of computational characteristics, including regular and irregular memory access patterns, as well as compute-bound and memory-bound tasks.

Summary of the 13 workloads evaluated, including their application areas, nature, and solution methodology.

Datasets included synthetic "Uniformly At Random" (UAR) data for tasks like sorting and convolution, alongside standard benchmarks such as the "Notre Dame 715" dataset for bundle adjustment and medical imaging volumes for ray casting.

Key Results and Insights

The authors compared their hybrid solutions against optimized GPU-only implementations across two platforms:

  • High-End Platform (Intel i7-980X + Tesla T10): Achieved an average 29% performance improvement. Notable gains were seen in List Ranking (57.7%) and Connected Components (45.16%).
  • Low-End Platform (Core 2 Duo + GT520): Surprisingly, commodity hardware saw even higher percentage gains, averaging a 37% improvement. This suggests that hybrid computing is highly relevant for everyday desktop users, not just supercomputing clusters.
  • Resource Efficiency: By fine-tuning the "work-share threshold," the authors achieved approximately 90% resource efficiency, meaning both processors were active and productive for the vast majority of the execution time.

Challenges and Future Directions

Despite the clear benefits, hybrid computing faces several hurdles. The primary bottleneck remains the PCIe bus, where the cost of transferring intermediate results between processors can sometimes negate parallel execution gains. Additionally, determining the optimal "work-share threshold" currently requires manual, empirical tuning for different hardware configurations.

Future work will focus on automating the mapping of tasks to processors—an NP-complete problem—and exploring tighter architectural integration, such as AMD Fusion or Intel MIC, to further reduce communication latency.

Summary updated

BibTeX
@misc{kothapalli2013cpu,
  author = {Kishore Kothapalli and Dip Sankar Banerjee and P. J. Narayanan and Surinder Sood and Aman Kumar Bahl and Shashank Sharma and Shrenik Lad and Krishna Kumar Singh and Kiran Kumar Matam and Sivaramakrishna Bharadwaj and Rohit Nigam and Parikshit Sakurikar and Aditya Deshpande and Ishan Misra and Siddharth Choudhary and Shubham Gupta},
  title = {{CPU and/or GPU: Revisiting the GPU Vs. CPU Myth}},
  year = {2013},
  eprint = {1303.2171},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1303.2171},
}
Figure