Skip to main content
QUICK REVIEW

[Paper Review] Automatic Tuning of Local Memory Use on GPGPUs

Tianyi David Han, Tarek S. Abdelrahman|arXiv (Cornell University)|Dec 22, 2014
Parallel Computing and Optimization TechniquesComputer Science13 references11 citations
TL;DR

This paper proposes a machine learning approach using Random Forest to automatically decide whether to apply local memory optimization in OpenCL kernels on GPGPUs. Trained on 560,000 synthetic benchmarks, the model predicts optimization benefits with 95% penalty-weighted accuracy on synthetic data and nearly 95% on real-world kernels, outperforming heuristics and analytical models.

ABSTRACT

The use of local memory is important to improve the performance of OpenCL programs. However, its use may not always benefit performance, depending on various application characteristics, and there is no simple heuristic for deciding when to use it. We develop a machine learning model to decide if the optimization is beneficial or not. We train the model with millions of synthetic benchmarks and show that it can predict if the optimization should be applied for a single array, in both synthetic and real benchmarks, with high accuracy.

Motivation & Objective

  • To address the lack of reliable heuristics for deciding when local memory optimization improves GPU kernel performance.
  • To develop an automated, data-driven method that predicts whether caching array regions in local memory will yield performance benefits.
  • To train a robust machine learning model using a large-scale synthetic benchmark suite to capture diverse memory access patterns.
  • To evaluate the model’s generalization on real-world kernels from domains like linear algebra and image processing.
  • To demonstrate that synthetic benchmarks can effectively train models for real GPU performance tuning.

Proposed method

  • Generate a large synthetic benchmark suite (5.6M kernel instances) covering common data access patterns in dense linear algebra and structured grids.
  • Extract kernel features such as data reuse, memory coalescing, register usage, and parallelism impact to train the model.
  • Train a Random Forest classifier with 20 trees and 4 attributes per node on 10% of synthetic data to predict optimization benefit.
  • Use oracle performance data (with/without local memory) as ground truth for model training and evaluation.
  • Evaluate model accuracy using two metrics: count-based accuracy and penalty-weighted accuracy, which accounts for performance loss on mispredictions.
  • Apply the trained model to real-world kernels to assess generalization and robustness.

Experimental results

Research questions

  • RQ1Can a machine learning model accurately predict whether local memory optimization improves kernel performance across diverse GPU workloads?
  • RQ2How effective is a model trained on synthetic benchmarks in generalizing to real-world OpenCL kernels?
  • RQ3What performance metrics best capture the practical impact of prediction errors in auto-tuning decisions?
  • RQ4How do factors like memory non-coalescing, data reuse, and parallelism reduction influence the optimization’s benefit?
  • RQ5Can synthetic benchmarks effectively replace real benchmarks for training high-accuracy auto-tuning models?

Key findings

  • The model achieves 86% count-based accuracy and 94.8% penalty-weighted accuracy on unseen synthetic kernel instances.
  • On real-world kernels, the model achieves nearly 95% penalty-weighted accuracy, with a minimum per-instance score of 30%, indicating rare but high-impact mispredictions.
  • The model’s performance on real kernels is consistent across diverse domains, including matrix multiplication, convolution, and MRI gridding.
  • The use of synthetic benchmarks enables training on a large, diverse dataset, which is critical for high-dimensional feature space modeling.
  • The model outperforms traditional heuristics and analytical models by capturing complex interactions between kernel characteristics and performance impact.
  • The study demonstrates that machine learning models trained on synthetic data can generalize effectively to real GPU workloads, enabling accurate auto-tuning of local memory usage.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.