OpenMathLib / OpenMathLib/OpenBLAS

Splitting gotoblas_t into parameters and kernels to re-use kernels between dynamic targets

オープン
#4,445 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C
スター
7.6k
フォーク
1.7k
平均マージ
1日 3時間
マージ済み PR(30日)
42

説明

This would greatly help with the competing demand of re-using our kernels between different cores with different parameters whilst not overly bloating the dynamic binary.

Looking at gotoblas_t (https://github.com/OpenMathLib/OpenBLAS/blob/develop/common_param.h#L1211), there are two parts, parameters such as:

  int sgemm_p, sgemm_q, sgemm_r;
  int sgemm_unroll_m, sgemm_unroll_n, sgemm_unroll_mn;

And function pointers, such as:

  int    (*sgemm_kernel   )(BLASLONG, BLASLONG, BLASLONG, float, float *, float *, float *, BLASLONG);
  int    (*sgemm_beta     )(BLASLONG, BLASLONG, BLASLONG, float, float *, BLASLONG, float *, BLASLONG, float  *, BLASLONG);

The parameters take up far less space than all of the compiled kernels, so I'm proposing splitting gotoblas_t into openblas_kernels and openblas_params data structures. That would allow our dynamic logic to do something like this:

case NEOVERSEV1:
   openblas_kernels = openblas_kernels_ARMV8SVE;
   openblas_params = openblas_params_NEOVERSEV1;

This allows sensible defaults (such as the minimum cache size for a particular core should it not be queriable dynamically) without duplicating the kernels multiple times.

We can mark these with DYNAMIC_KERNELS and DYNAMIC_PARAMS in the Makefile, DYNAMIC_LIST would build both for all and DYNAMIC_ARCH would be our current favourites.

@martin-frbg, what do you think?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

common_param.h の gotoblas_t から始め、カーネルとパラメータを選択する動的ターゲットのロジックを追跡します。次に、DYNAMIC_KERNELS、DYNAMIC_PARAMS、DYNAMIC_LIST、DYNAMIC_ARCH の Makefile 定義を調べます。パラメータと関数ポインタが別々の構造体になり、動的ターゲットが共有カーネルとターゲット固有のパラメータを組み合わせられ、既存のビルドモードが引き続きサポートされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c
領域
build-system, performance
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。