Skip to main content
QUICK REVIEW

[Paper Review] Auto-Tuning High-Performance Programs Using Model Checking in Promela

Natalia Garanina, Sergey Staroletov|arXiv (Cornell University)|May 16, 2023
Formal Methods in VerificationComputer Science3 citations
TL;DR

This paper proposes a novel model checking-based approach to accelerate auto-tuning of OpenCL programs by leveraging counterexamples from SPIN verification to guide parameter search, achieving performance-optimal configurations without real hardware. The method models OpenCL program behavior in Promela, enabling formal verification of optimality properties and efficient exploration of tuning parameter spaces, with experimental results showing alignment with real-world performance trends for minimum computation kernels.

ABSTRACT

The paper combines research approaches that traditionally have been disjoint: 1) model checking as used in formal verification of programs, and 2) auto-tuning as often used in high-performance computing. Auto-tuning frameworks optimize parallel programs by finding the optimal values of the performance-critical parameters -- so-called tuning parameters -- for a particular high-performance architecture and input data size. As there are many parameters influencing program's performance, finding the optimal parameter configuration is a hardly manageable task even for experts. Auto-tuning automates this process, but it is often time-consuming. We apply model checking for accelerating auto-tuning by using a counterexample constructed during the verification of the optimality property of the program. We describe in detail an implementation of our approach for programs written in OpenCL -- the standard for programming modern high-performance architectures -- using the model representation language Promela and the popular SPIN verification tool, and we report experimental results for an application use case.

Motivation & Objective

  • To bridge formal verification via model checking with high-performance computing auto-tuning, traditionally disjoint fields.
  • To address the challenge of manually or heuristically finding optimal tuning parameters (e.g., workgroup size, tile size) in OpenCL programs.
  • To enable hardware-independent auto-tuning by modeling program behavior formally in Promela, avoiding reliance on physical target architectures.
  • To improve search efficiency in auto-tuning by using counterexamples from SPIN verification to guide parameter space exploration.
  • To validate the approach on real OpenCL kernels and demonstrate consistency with observed performance behavior.

Proposed method

  • Model OpenCL program behavior using Promela, abstracting from low-level computation while preserving synchronization and interaction logic.
  • Express the optimality property of a program (e.g., minimal execution time) as a temporal logic formula in LTL for verification.
  • Use the SPIN model checker to verify whether the optimality property holds for a given parameter configuration.
  • Generate counterexamples when the property fails, which reveal suboptimal configurations and guide the search toward better parameter values.
  • Iteratively refine parameter values using counterexample feedback to converge on optimal configurations without running on real hardware.
  • Customize the model to reflect architectural characteristics (e.g., memory access times, warp scheduling) for improved accuracy and scalability.

Experimental results

Research questions

  • RQ1Can model checking with counterexample generation be effectively used to accelerate auto-tuning of OpenCL programs?
  • RQ2How does the formal model in Promela compare to real hardware execution in predicting optimal tuning parameters?
  • RQ3To what extent can the absence of physical hardware be compensated by precise architectural modeling in Promela?
  • RQ4Can counterexample-guided search outperform traditional auto-tuning frameworks in terms of time-to-solution?
  • RQ5How can architectural features like memory hierarchy and warp scheduling be abstracted in a Promela model to reflect real performance behavior?

Key findings

  • The Promela-based model accurately reflects the performance behavior of OpenCL kernels, with workgroup size (WG) and tile size (TS) having the most significant impact on execution time.
  • Optimal configurations found via model checking consistently used the maximum allowed WG values, mirroring results from real hardware experiments.
  • The model checker identified suboptimal configurations through counterexamples, enabling efficient pruning of the parameter space.
  • Execution times in the model correlated strongly with real-world measurements, validating the model's predictive accuracy for the minimum computation kernel.
  • The approach successfully identified optimal parameter sets without requiring access to the target hardware, demonstrating feasibility for early-stage performance tuning.
  • The method scales to larger input sizes, with future work aiming to extend it to matrix multiplication on modern Ampere GPUs.

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.