Skip to main content
QUICK REVIEW

[Paper Review] Automating the Last-Mile for High Performance Dense Linear Algebra

Richard Veras, Tze Meng Low|arXiv (Cornell University)|Nov 24, 2016
Parallel Computing and Optimization TechniquesComputer Science18 references6 citations
TL;DR

This paper proposes an analytical, model-driven approach to automatically generate high-performance SIMD micro-kernels for dense linear algebra, focusing on the Gemm kernel's core outer-product computation. By modeling instruction-level parallelism and register usage, it generates competitive kernels without empirical tuning, achieving 95–100% of OpenBLAS performance across multiple architectures while preserving TLB efficiency.

ABSTRACT

High performance dense linear algebra (DLA) libraries often rely on a general matrix multiply (Gemm) kernel that is implemented using assembly or with vector intrinsics. In particular, the real-valued Gemm kernels provide the overwhelming fraction of performance for the complex-valued Gemm kernels, along with the entire level-3 BLAS and many of the real and complex LAPACK routines. Thus,achieving high performance for the Gemm kernel translates into a high performance linear algebra stack above this kernel. However, it is a monumental task for a domain expert to manually implement the kernel for every library-supported architecture. This leads to the belief that the craft of a Gemm kernel is more dark art than science. It is this premise that drives the popularity of autotuning with code generation in the domain of DLA. This paper, instead, focuses on an analytical approach to code generation of the Gemm kernel for different architecture, in order to shed light on the details or voo-doo required for implementing a high performance Gemm kernel. We distill the implementation of the kernel into an even smaller kernel, an outer-product, and analytically determine how available SIMD instructions can be used to compute the outer-product efficiently. We codify this approach into a system to automatically generate a high performance SIMD implementation of the Gemm kernel. Experimental results demonstrate that our approach yields generated kernels with performance that is competitive with kernels implemented manually or using empirical search.

Motivation & Objective

  • To address the 'last-mile' challenge of manually implementing architecture-specific Gemm micro-kernels, traditionally seen as a 'dark art' requiring expert assembly-level tuning.
  • To shift from empirical autotuning to analytical modeling of micro-kernel performance, particularly focusing on outer-product computation and instruction-level parallelism.
  • To generate micro-kernels that maintain high performance while avoiding register spilling, which disrupts TLB miss avoidance in the larger Gemm algorithm.
  • To demonstrate that analytical modeling can produce kernels competitive with manually optimized ones, such as those in OpenBLAS, across diverse architectures.

Proposed method

  • The micro-kernel is decomposed into atomic 'unit updates' representing outer-product computations, which are analyzed for performance using analytical models.
  • Instruction-level parallelism is modeled by analyzing how SIMD instructions can be scheduled to minimize bottlenecks in fetch/decode and execution stages.
  • Register pressure and spilling are analytically evaluated by varying N-update overlap in software pipelining, with performance and TLB misses measured via PAPI.
  • A static scheduling model is used to estimate running time for each micro-kernel variant, selecting the optimal configuration without empirical search.
  • The generated micro-kernel is embedded in the GotoBLAS/BLIS algorithm, which ensures data movement efficiency and minimal TLB misses.
  • The approach generates kernels that fit within the larger Gemm stack without disrupting its performance characteristics, particularly TLB behavior.

Experimental results

Research questions

  • RQ1Can an analytical model accurately predict the performance of SIMD-optimized Gemm micro-kernels without relying on empirical tuning?
  • RQ2How does register spilling in the micro-kernel affect TLB miss rates and overall Gemm performance in the GotoBLAS/BLIS framework?
  • RQ3What is the optimal instruction scheduling strategy for outer-product computation that maximizes utilization of SIMD units and minimizes pipeline bottlenecks?
  • RQ4Can a model-based code generation system produce micro-kernels competitive with expert-optimized implementations like those in OpenBLAS?

Key findings

  • The analytical model successfully identifies high-performance micro-kernel configurations without requiring exhaustive search or autotuning.
  • Generated kernels achieve 95–100% of OpenBLAS performance on multiple architectures, demonstrating strong competitiveness with expert-tuned kernels.
  • Register spilling significantly degrades overall Gemm performance not only due to memory latency but also by increasing TLB misses, disrupting the algorithm’s design for TLB efficiency.
  • Non-uniform N-update sizes lead to performance degradation due to larger instruction clusters that bottleneck fetch and decode stages.
  • The model-based approach preserves the TLB miss avoidance properties of the GotoBLAS/BLIS algorithm, which is critical for end-to-end performance.
  • When parallelized on SMP systems like the Xeon Phi, the generated kernels scale similarly to OpenBLAS, indicating good portability and performance portability.

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.