Tackling the Matrix Multiplication Micro-kernel Generation with Exo

要約

行列乗算 (GEMM) の最適化は、過去数十年間にわたって必要とされてきました。
この演算は、多種多様な科学アプリケーションで広く使用されているため、BLIS、OpenBLAS、Intel OneAPI などの現在の線形代数ライブラリの主力とみなされています。
GEMM は通常、GotoBLAS の哲学に従って実装されます。これは、GEMM オペランドをタイル化し、一連のネストされたループを使用してパフォーマンスを向上させます。
これらのアプローチは、マイクロカーネルと呼ばれるハードウェア指向の高性能コードの小さな部分を通じて、アーキテクチャの最大の計算能力を引き出します。
ただし、このアプローチでは、開発者は無視できない労力をかけて、新しいハードウェアごとに専用のマイクロカーネルを生成する必要があります。
この作業では、組み込み関数またはアセンブリ言語で記述された手動開発のマイクロカーネルに近い (またはそれ以上の) パフォーマンスを発揮する Exo コンパイラーを使用してマイクロカーネルを生成するための段階的な手順を示します。
また、私たちのソリューションは、ハードウェア ターゲットがその命令の簡潔なライブラリベースの記述によって完全に指定されるため、生成されたコードの移植性も向上します。

要約(オリジナル)

The optimization of the matrix multiplication (or GEMM) has been a need during the last decades. This operation is considered the flagship of current linear algebra libraries such as BLIS, OpenBLAS, or Intel OneAPI because of its widespread use in a large variety of scientific applications. The GEMM is usually implemented following the GotoBLAS philosophy, which tiles the GEMM operands and uses a series of nested loops for performance improvement. These approaches extract the maximum computational power of the architectures through small pieces of hardware-oriented, high-performance code called micro-kernel. However, this approach forces developers to generate, with a non-negligible effort, a dedicated micro-kernel for each new hardware. In this work, we present a step-by-step procedure for generating micro-kernels with the Exo compiler that performs close to (or even better than) manually developed microkernels written with intrinsic functions or assembly language. Our solution also improves the portability of the generated code, since a hardware target is fully specified by a concise library-based description of its instructions.

arxiv情報

著者 Adrián Castelló,Julian Bellavita,Grace Dinh,Yuka Ikarashi,Héctor Martínez
発行日 2023-10-27 08:28:03+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL, cs.MS, cs.PF パーマリンク