OpenMathLib / OpenMathLib/OpenBLAS
GEMM slower than GEMV slower than AXPY equivalent on Intel i5 CPU
オープン
まだ誰も着手していません。
- 主要言語
- C
- スター
- 7.6k
- フォーク
- 1.7k
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 42
説明
Consider the following Julia code (using Julia 0.4-dev):
let
B = randn(1000, 1000)
v = randn(1000)
y = randn(1000); sB = [slice(B, :, j) for j = 1:size(B, 2)]
@time for i = 1:1000;BLAS.gemm!('N', 'N', 1.0, B, v, 1.0, y);end;
@time for i = 1:1000;BLAS.gemv!('N', 1.0, B, v, 1.0, y);end;
@time for i = 1:1000;
for j = 1:size(B,2)
BLAS.axpy!(v[j], sB[j], y)
end
end
end
On @andreasnoack's machine, a Macbook Pro with i7-4870HQ CPU, GEMM is 4 times slower than GEMV:
elapsed time: 1.084909686 seconds (0 bytes allocated)
elapsed time: 0.2644927 seconds (0 bytes allocated)
elapsed time: 0.321705553 seconds (0 bytes allocated)
On my machine, a Macbook Pro with i5-4258U, I get similar behavior, but also that the AXPY equivalent is the fastest of the 3 computations:
elapsed time: 1.693223657 seconds (0 bytes allocated)
elapsed time: 0.818590556 seconds (0 bytes allocated)
elapsed time: 0.715702898 seconds (0 bytes allocated)
I find the relative performance behaviors surprising.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、報告されている Intel CPU 上で BLAS.gemm!、BLAS.gemv!、BLAS.axpy! を使って Julia ベンチマークを再現し、その後、相対的な実行時間を比較します。issue にはソースファイル、テスト、または具体的な変更が記載されていないため、完了条件を定義する前に、目標がこの差を説明することなのか、ある操作を改善することなのかを明確にしてください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, julia
- 領域
- hpc, performance
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100