フィルターのクリア

GPU backslash performance much slower than CPU

3 ビュー (過去 30 日間)
Meme Young
Meme Young 2020 年 12 月 27 日
編集済み: Matt J 2022 年 5 月 26 日
I am doing numerical power flow caclulation by modifying the functions of matpower, an open source toolbox. By modifying its function newtonpf.m, GPU computation can be implemented. However, I found that GPU performance is much much slower than CPU. When calculating the built-in case3012wp of matpower, the matrix in newtonpf.m will be :
A: 5725 * 5725 sparse double, b: 5725 * 1 double.
The process of A \ b in the 1st iteration of newtonpf() will generally take around 0.01 sec on my i7-10750H + RTX 2070super MSI-GL65.
But if A and b are changed into GPU arrays, the process of A \ b will take the following time if A is the following types:
full double, 0.8 sec
sparse double, 4 sec
full single, 0.1 sec
(sparse single is not supported)
So why is the diference in performance? I thought GPU could do things much faster than CPU.
Files are attached as follows. Atest is sparse and Agpu is a sparse gpu array. All are doubles.
  9 件のコメント
kant
kant 2022 年 5 月 26 日
I also have this problem for my matlab code? Has the problem been solved?
Matt J
Matt J 2022 年 5 月 26 日
編集済み: Matt J 2022 年 5 月 26 日
@kant It has been concluded that this is expected behavior, but see below.

サインインしてコメントする。

回答 (1 件)

Matt J
Matt J 2020 年 12 月 27 日
This thread looks relevant. It appears that sparse mldivide on the GPU is not expected to be faster.
  13 件のコメント
Meme Young
Meme Young 2020 年 12 月 30 日
What do you mean sparse solver algorithm Mr Knight? like pcg()? I have tried it is not as efficient as this way: reordering using amd(), LU decomp, and two backslashes based on the decomp, especially when coping with the type of sparse matrix that I uploaded
Joss Knight
Joss Knight 2021 年 1 月 10 日
編集済み: Joss Knight 2021 年 1 月 10 日
Yes, PCG, GMRES, CGS, LSQR, QMR, TFQMR, BICG, BICGSTAB. Try them all, play with tolerance, iterations and preconditioning - something is likely to work. I'm not an expert in this field but this is what the sparse community tend to do.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSparse Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by