OpenMathLib / OpenMathLib/OpenBLAS
Splitting gotoblas_t into parameters and kernels to re-use kernels between dynamic targets
まだ誰も着手していません。
- 主要言語
- 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?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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