Matrix Engines for High Performance Computing: A Paragon of Performance or Grasping at Straws?

Jens Domke, Emil Vatai, Aleksandr Drozd, Peng Chen, Yosuke Oyama, Lingqi Zhang, Shweta Salaria, Daichi Mukunoki, Artur Podobas, Mohamed Wahib, Satoshi Matsuoka

TL;DR

As Moore’s Law fades, hardware architects are increasingly turning to specialized "Matrix Engines" (MEs)—like NVIDIA’s Tensor Cores—to boost performance. This paper provides a sobering reality check: while MEs are a game-changer for Deep Learning, they offer a meager ~5% reduction in total node hours for traditional High-Performance Computing (HPC) workloads, as most scientific applications simply don't spend enough time in dense matrix multiplication.

What Problem Does This Paper Address?

We are in the "Post-Moore" era, where traditional general-purpose CPU scaling has stalled. To keep performance climbing, vendors are integrating specialized hardware units designed specifically for General Matrix Multiplication (GEMM). These units (like Intel’s AMX or NVIDIA’s Tensor Cores) offer massive theoretical throughput but often require lower precision (FP16/BF16).

The authors tackle a fundamental question: Is the "matrix-fication" of hardware actually useful for the broader scientific community? While Deep Learning (DL) is built on matrices, traditional HPC involves diverse algorithms (stencil computations, sparse linear algebra, graph analytics). The paper investigates whether the silicon area dedicated to MEs is a "paragon of performance" for all or just "grasping at straws" to find performance gains where they don't exist for most users.

Methods

The researchers employed a multi-pronged analytical approach:

  1. Historical Analysis: They examined a full year of operation data from the K Computer (RIKEN), covering over 543 million node hours to see how many applications even called GEMM-related symbols.
  2. Software Dependency Mapping: They analyzed the Spack package manager (4,371 packages) to determine how many HPC software stacks actually depend on BLAS (Basic Linear Algebra Subprograms) libraries.
  3. Extensive Profiling: They profiled 77 different HPC benchmarks (including TOP500, ECP proxy apps, RIKEN Fiber, and SPEC) using the Score-P tool to measure the exact percentage of time spent in GEMM vs. other operations.
  4. Performance Projection: Using the profiling data, they modeled how much a hypothetical 4x or "infinitely fast" matrix engine would actually reduce the total runtime of a supercomputer.
  5. Precision Emulation: They tested the Ozaki scheme, a mathematical method to emulate high-precision (FP64) results using low-precision (FP16) matrix engines, to see if MEs could be "tricked" into being useful for precision-sensitive science.

Datasets

  • Historical Data: One year of K Computer logs (April 2018 – March 2019).
  • Software Stack: 4,371 packages from the Spack package manager.
  • HPC Benchmarks: 77 total, including HPL, HPCG, ECP Proxy Apps (AMG, Quicksilver, etc.), RIKEN Fiber Miniapps, and the SPEC CPU/OMP/MPI suites.
  • DL Models: BERT, Cosmoflow, VGG16, ResNet50, DeepLabV3, SSD300, and NCF.

Key Insights and Ideas

  • The GEMM Mirage: While ~53% of applications on the K Computer could call GEMM, the actual time spent inside those routines is tiny for most. Out of 77 HPC benchmarks, only 10 spent significant time in GEMM.
  • Amdahl’s Law is Relentless: Because GEMM is such a small part of the total runtime for most scientific domains (like weather forecasting or CFD), even an infinitely fast matrix engine would only reduce total node hours on a system like the K Computer by about 7.1%.
  • Dark Silicon Justification: The authors suggest MEs might be "free" in terms of power. Since chips hit power limits (TDP) before they can use all their transistors, adding MEs doesn't necessarily "steal" power from the main cores; they just sit idle when not needed.
  • The Portability Tax: Unlike SIMD (vector) instructions, which compilers are getting better at handling, MEs often require manual code rewrites or specific library calls, creating a significant "programmability burden" for scientists.

Key Results

  • HPL is the Outlier: The High-Performance Linpack (HPL) benchmark spends 76.8% of its time in GEMM. This explains why supercomputer rankings look great with MEs, even if real-world apps don't benefit as much.
  • Deep Learning Speedups: For actual DL models, Tensor Cores provided a 2x to 4x practical speedup, which is significant but far below the 7.6x theoretical peak of the hardware.
  • HPC Reality: For a representative mix of science at Argonne National Laboratory (ANL), a 4x faster ME would only yield an 11.5% reduction in node hours.
  • Precision Emulation Performance: Using the Ozaki scheme to get FP64 results from FP16 Tensor Cores worked, but it was generally slower than just using native FP64 units on high-end GPUs like the V100.

Limitations and Future Work

  • Input Sensitivity: The Ozaki scheme for emulating high precision is highly dependent on the range of input data; if the numbers vary too wildly, the performance drops significantly.
  • Software Gap: The study notes that while MEs exist in hardware, compiler support for auto-generating ME code is still in its infancy.
  • Future Work: The authors suggest exploring how MEs could be used for non-matrix patterns, such as accelerating sparse matrix-matrix multiplication or stencil kernels, to make them more broadly useful for HPC.

Summary updated

BibTeX
@inproceedings{domke2021matrix,
  author = {Jens Domke and Emil Vatai and Aleksandr Drozd and Peng Chen and Yosuke Oyama and Lingqi Zhang and Shweta Salaria and Daichi Mukunoki and Artur Podobas and Mohamed Wahib and Satoshi Matsuoka},
  title = {{Matrix Engines for High Performance Computing: A Paragon of Performance or Grasping at Straws?}},
  booktitle = {IPDPS},
  year = {2021},
  doi = {10.1109/ipdps49936.2021.00114},
}
Figure