Skip to main content
QUICK REVIEW

[論文レビュー] The Linear Algebra Mapping Problem

Christos Psarras, Henrik Barthels|arXiv (Cornell University)|Nov 21, 2019
Parallel Computing and Optimization Techniques参考文献 38被引用数 7
ひとこと要約

本論文は、高水準の線形代数コードと低水準の最適化ライブラリの間のパフォーマンスギャップを特定する「線形代数マッピング問題」を導入する。MATLAB、Julia、NumPy などの言語が高水準の行列式を効率的なカーネル呼び出しに変換する能力を評価し、現在のコンパイラおよびインタプリタにおける顕著な非最適性を明らかにし、このギャップを埋めるための、より良い言語およびライブラリ設計のガイドラインを提案する。

ABSTRACT

We observe a disconnect between the developers and the end users of linear algebra libraries. On the one hand, the numerical linear algebra and the high-performance communities invest significant effort in the development and optimization of highly sophisticated numerical kernels and libraries, aiming at the maximum exploitation of both the properties of the input matrices, and the architectural features of the target computing platform. On the other hand, end users are progressively less likely to go through the error-prone and time consuming process of directly using said libraries by writing their code in C or Fortran; instead, languages and libraries such as Matlab, Julia, Eigen and Armadillo, which offer a higher level of abstraction, are becoming more and more popular. Users are given the opportunity to code matrix computations with a syntax that closely resembles the mathematical description; it is then a compiler or an interpreter that internally maps the input program to lower level kernels, as provided by libraries such as BLAS and LAPACK. Unfortunately, our experience suggests that in terms of performance, this translation is typically vastly suboptimal. In this paper, we first introduce the Linear Algebra Mapping Problem, and then investigate how effectively a benchmark of test problems is solved by popular high-level programming languages. Specifically, we consider Matlab, Octave, Julia, R, Armadillo (C++), Eigen (C++), and NumPy (Python); the benchmark is meant to test both standard compiler optimizations such as common subexpression elimination and loop-invariant code motion, as well as linear algebra specific optimizations such as optimal parenthesization of a matrix product and kernel selection for matrices with properties. The aim of this study is to give concrete guidelines for the development of languages and libraries that support linear algebra computations.

研究の動機と目的

  • 高水準の線形代数抽象化と BLAS や LAPACK のような低水準の最適化ライブラリとの間のパフォーマンスギャップを特定すること。
  • 人気のある高水準言語が高水準の行列式を効率的な低水準カーネルにマッピングする効率性を調査すること。
  • 一般の最適化と線形代数固有の最適化がパフォーマンスに与える影響を評価すること。
  • 将来の言語およびライブラリの線形代数計算におけるパフォーマンス向上に役立つ具体的なガイドラインを提供すること。

提案手法

  • 本研究では、高水準の行列式を最適な低水準カーネル呼び出しに効率的に変換する課題として、線形代数マッピング問題を定義する。
  • 共通部分式の削除、ループ不変コードの移動、行列固有の最適化(最適な括弧の付け方など)のサポートを評価するためのテスト問題のベンチマークを設計する。
  • MATLAB、Octave、Julia、R、Armadillo(C++)、Eigen(C++)、NumPy(Python)の複数の言語でベンチマークを実行する。
  • 実行時間の測定を、既知の最適なカーネル使用法と比較することで、一般最適化および線形代数固有の最適化の両方の効果を評価する。
  • コンパイラおよびインタプリタが数学的表記を効率的な数値カーネルにマッピングする能力、特に行列の特別な性質を持つ場合のマッピングの精度に焦点を当てる。

実験結果

リサーチクエスチョン

  • RQ1高水準言語は、行列式を最適な BLAS や LAPACK カーネルにどの程度効果的にマッピングするか?
  • RQ2現在のコンパイラおよびインタプリタは、線形代数コードにおいて共通部分式の削減やループ不変コードの移動をどの程度効果的に活用しているか?
  • RQ3特定の性質を持つ行列に対して、言語は適切なカーネルを選択するのにどの程度効果的か?
  • RQ4高水準構文から低水準カーネルへの変換におけるパフォーマンスボトルネックは何か?

主な発見

  • 高水準の行列式から低水準カーネルへの変換は、通常著しく非最適であり、顕著なパフォーマンス劣化を引き起こす。
  • 洗練された高水準言語を用いても、最適実行と実際の実行との間のパフォーマンスギャップは依然として顕著である。
  • 共通部分式の削減やループ不変コードの移動は、線形代数の文脈ではしばしば効果的に適用されていない。
  • 行列積の最適な括弧の付け方や、行列の性質に基づくカーネル選択は、現在のコンパイラおよびインタプリタによって頻繁に無視されている。

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。