DGEQRF performance on block p-cyclic matrix

DGEQRF performance on block p-cyclic matrix

Jeffrey P.的头像

Hello, first time poster here.

My work includes finding the QR decomposition of a p-cyclic matrix M. It is square, L blocks high, L blocks wide, and each block is N by N. Each block column has two nonzero blocks on and directly below the diagonal, like so

M11                             M1L
M21 M22
        M32 M33
                 ...     ...
                         MLL-1 MLL

I am using a Block Orthogonal Factorization method to find the QR but want to compare it to DGEQRF in terms of time and speed. The code is attached.

Now my problem is that although BSOF always has a better timing than DGEQRF, as L increases and the amount of zeroes in M increases, DGEQRF gets much much faster in terms of GFlop/s. Attached are results from a test where the size of M is constant at 10,000 and L grows as N decreases. If DGEQRF were unaffected by structure, its speed and execution time would be the same for each test, but it is not. So my question is why is DGEQRF going so fast? My theory is that there is some heuristic which skips some amount of flops when it sees some formation of zeroes, making my flop count incorrect and leading to a bad GFlop rate. But I have no idea how/where this is being done.

I should also note that I have run benchmark testing with DGEMM and DGEQRF on a fully random matrix and get normal speeds of ~140GFlops and ~120GFlops respectively. So my DGEQRF speeds on M of ~1000GFlops must be off. Those results are attached as well.

Thanks!

附件尺寸
下载 bsof.cpp5.34 KB
下载 benchmark-gflops.txt2.28 KB
下载 bsof.txt563 字节
2 帖子 / 0 new
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
Alexander Kobotov (Intel)的头像
Best Reply

Hi Jeffrey,

You are right, DGEQRF (and all other LQ/QL/RQ including DORGQR, DORMQR and similar) indeed has an optimization to skip zeros. The optimization is actually derived from NETLIB LAPACK code. If you'd like to learn details you could explore code of DGEQRF and DLARFB which is used underneath of DGEQRF. MKL implementation differs but basics of skipping zeroes are similar.
There is no good way to count exact flops for that case, since according to strategy of reblocking matrix into smaller ones not all zeroes are skipped.

W.B.R.,
Alexander

登陆并发表评论。