Multi-threaded dense linear algebra libraries for low-power asymmetric multicore processors

Sandra Catalán, José R. Herrero, Francisco D. Igual, Rafael Rodríguez-Sánchez, Enrique S. Quintana-Ortí, Chris Adeniyi-JonesJ. Comput. Sci 2018

Abstract

Modern mobile and low-power devices increasingly utilize Asymmetric Multicore Processors (AMPs) to balance performance and energy efficiency. However, standard high-performance computing (HPC) libraries often suffer from significant load imbalances on these architectures. This paper presents a strategy for optimizing dense linear algebra libraries (BLAS and LAPACK) specifically for AMPs. By employing a two-tiered parallelization strategy within the BLIS framework—dynamic workload distribution across heterogeneous core types and static repartitioning within clusters—the authors achieve performance levels reaching 93% of the theoretical peak on the Samsung Exynos 5422 SoC.

Introduction

Most high-performance computing (HPC) libraries are designed for symmetric processors where every core is identical. In contrast, modern mobile and low-power devices often use Asymmetric Multicore Processors (AMPs), such as ARM’s big.LITTLE architecture, which pair "fast/power-hungry" cores with "slow/energy-efficient" ones.

When running standard multi-threaded libraries on an AMP, fast cores frequently idle while waiting for slow cores to finish their assigned tasks, leading to a classic load imbalance problem. While complex runtime systems can manage tasks, rewriting entire libraries like LAPACK to be "task-aware" is a massive undertaking. This research explores whether the complexity of asymmetry can be encapsulated within the BLAS layer so that legacy software like LAPACK benefits automatically.

Methodology

The authors built their solution on the BLIS (BLAS-like Library Instantiation Software) framework. Their approach involves three main components:

  1. Two-Tiered Parallelization:
    • Coarse-grain (Dynamic): The middle loop of the matrix multiplication algorithm (Loop 3) is parallelized using a dynamic scheduler. This allows the "big" cores to automatically grab more work units than the "LITTLE" cores.
  2. Fine-grain (Static): Within each cluster of identical cores, static scheduling is used for the inner loops (Loops 4 or 5) to minimize synchronization overhead.
  3. Cache Optimization: Cache configuration parameters ($m_c, n_c, k_c$) were manually tuned specifically for the Cortex-A15 and Cortex-A7 architectures to ensure data remains in the L1/L2 caches during computation.
  4. Shape-Aware Tuning: Recognizing that LAPACK often calls BLAS with rectangular matrices, the authors adjusted scheduling strategies and cache block sizes to maintain load balance even when one matrix dimension is small.
Table of Level-3 BLAS kernels and their operations optimized in this study.

Experimental Setup

The study utilized the Samsung Exynos 5422 SoC on an ODROID-XU3 board. This architecture features a cluster of four high-performance Cortex-A15 cores and a cluster of four energy-efficient Cortex-A7 cores.

The Samsung Exynos 5422 SoC architecture featuring Cortex-A15 and Cortex-A7 clusters.

Performance was evaluated using standard numerical benchmarks, including Level-3 BLAS kernels (GEMM, SYMM, TRMM, TRSM, SYRK, SYR2K) and LAPACK routines such as Cholesky factorization (POTRF), LU factorization (GETRF), and reduction to tridiagonal form (SYTRD).

Key Results and Insights

  • Peak Efficiency: For square matrix multiplication (GEMM), the optimized library achieved 12.7 GFLOPS, roughly 93% of the ideal peak performance for the hardware. The POTRF routine also reached ~93% efficiency as it is dominated by the SYRK kernel.
  • The "D3S4" Strategy: The most effective parallelization strategy (dubbed D3S4) involves dynamic scheduling at Loop 3 and static scheduling at Loop 4, providing the best balance between flexibility and low overhead.
  • Architectural Bottlenecks: GETRF (LU) reached only 84% of the ideal peak due to the sequential nature of the "panel factorization" step. Furthermore, routines relying on Level-2 BLAS (matrix-vector), like SYTRD, performed poorly as they are limited by memory bandwidth rather than raw computational power.

Conclusion

This work demonstrates that a two-tiered parallelization strategy within the BLAS layer can effectively mitigate the performance penalties of processor asymmetry. While Level-3 BLAS routines see massive gains, future work is required to address memory-bound Level-2 BLAS routines and sequential bottlenecks in LU and QR factorizations through "look-ahead" strategies.

Summary updated

BibTeX
@article{catalan2018multi,
  author = {Sandra Catalán and José R. Herrero and Francisco D. Igual and Rafael Rodríguez-Sánchez and Enrique S. Quintana-Ortí and Chris Adeniyi-Jones},
  title = {{Multi-threaded dense linear algebra libraries for low-power asymmetric multicore processors}},
  journal = {J. Comput. Sci.},
  year = {2018},
  doi = {10.1016/j.jocs.2016.10.020},
}
Figure