[Paper Review] A model-driven approach for a new generation of adaptive libraries
This paper proposes a machine learning-driven, model-based framework to dynamically select optimal algorithmic parameters for GPU-accelerated BLAS libraries, specifically targeting data-driven workloads like matrix multiplication. By training decision trees on synthetic and real datasets, the approach achieves up to 3x speedup on NVIDIA Pascal and 2.5x on ARM Mali GPUs compared to traditional hard-coded optimizations.
Efficient high-performance libraries often expose multiple tunable parameters to provide highly optimized routines. These can range from simple loop unroll factors or vector sizes all the way to algorithmic changes, given that some implementations can be more suitable for certain devices by exploiting hardware characteristics such as local memories and vector units. Traditionally, such parameters and algorithmic choices are tuned and then hard-coded for a specific architecture and for certain characteristics of the inputs. However, emerging applications are often data-driven, thus traditional approaches are not effective across the wide range of inputs and architectures used in practice. In this paper, we present a new adaptive framework for data-driven applications which uses a predictive model to select the optimal algorithmic parameters by training with synthetic and real datasets. We demonstrate the effectiveness of a BLAS library and specifically on its matrix multiplication routine. We present experimental results for two GPU architectures and show significant performance gains of up to 3x (on a high-end NVIDIA Pascal GPU) and 2.5x (on an embedded ARM Mali GPU) when compared to a traditionally optimized library.
Motivation & Objective
- Address the performance portability challenge in data-driven HPC workloads, such as deep learning and graph analytics, where input data characteristics vary widely.
- Overcome limitations of traditional BLAS libraries that use fixed, hand-tuned parameters or naive heuristics, which underperform across diverse input sizes and hardware.
- Enable adaptive runtime selection of optimal GEMM (general matrix multiplication) configurations based on input dimensions and hardware features.
- Develop a generalizable, architecture-agnostic solution that avoids reliance on low-level instruction sets or architecture-specific code generation.
- Improve performance portability across heterogeneous systems—especially GPUs—by learning optimal parameter choices from training data rather than hard-coding them.
Proposed method
- Employ decision trees as a white-box, interpretable supervised classifier to predict the best GEMM implementation and tuning parameters based on input features such as matrix dimensions.
- Generate training datasets using three approaches: synthetic data with uniform sampling, real-world data from application workloads, and hybrid sampling to cover edge cases.
- Train predictive models on diverse input configurations to enable runtime selection of optimal kernel configurations (e.g., block sizes, tiling strategies) for specific matrix shapes.
- Integrate the trained model into CLBlast, an open-source OpenCL BLAS library, to enable adaptive selection of optimized kernels at runtime.
- Use cross-architecture training to improve model generalization, allowing models trained on one GPU to be applied to others with minimal retraining.
- Minimize runtime overhead by optimizing model inference and ensuring the predictive model adds negligible latency compared to the performance gains achieved.
Experimental results
Research questions
- RQ1Can a machine learning-based predictive model effectively select optimal GEMM configurations across diverse input sizes and GPU architectures?
- RQ2How does model accuracy correlate with performance improvement when using synthetic versus real-world training data?
- RQ3To what extent can a lightweight, interpretable model like a decision tree outperform traditional heuristic-based selection in data-driven workloads?
- RQ4What is the impact of training data density and diversity on model generalization and runtime performance?
- RQ5Can the proposed framework achieve significant speedups without requiring architecture-specific code or instruction set exposure?
Key findings
- The model-driven approach achieved up to 3x speedup on a high-end NVIDIA Pascal GPU and 2.5x on an embedded ARM Mali GPU compared to a traditionally optimized BLAS library.
- Even with moderate decision tree accuracy, performance gains were substantial because mispredictions had limited impact when the training dataset was dense and representative.
- Training on synthetic data alone was insufficient for optimal performance; combining synthetic and real-world data improved model robustness and generalization.
- The framework demonstrated strong cross-architecture performance portability, enabling models trained on one GPU to be effective on others with minimal retraining.
- Runtime overhead of the predictive model was negligible, making it practical for integration into production-quality libraries like CLBlast.
- The approach is extensible to other compute-intensive kernels and complex workloads such as graph analytics, where optimal data-parallel strategies are hard to pre-define.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.