Is it possible to divide a LU factorization into several smaller parts to reduce memory usage?

4 views (last 30 days)
I’m trying to speed up a script I have by doing a LU factorization on the GPU rather than on the CPU. The LU function is natively supported for GPU arrays and it is much faster to calculate on my GPU compared to my CPU, however, pretty soon when the matrix I want to factorize becomes large enough the GPU runs out of memory and I can’t do the calculation.
So I was wondering if there is any way to divide the LU factorization into smaller parts that can be done on the GPU incrementally and sent back to the RAM where the final result is attained via a concatenation or something to avoid running out of GPU memory?
Illustrative example (that doesn’t work) of what I mean:
% If this is the original situation that required too much memory
[L,U] = lu(A);
% Can the factorization be done in two or more parts in any way, perhaps something similar to this and then afterwards the results are combined to be equal to L & U ?
[L1,U1] = lu(A(1:size(A,1)/2, 1:size(A,2)/2));
[L2,U2] = lu(A(size(A,1)/2:end, size(A,2)/2:end));
I realize that what I wrote here will never work since the resulting L1 & L2 have the wrong sizes to ever become L , but in general, is there a way of doing this in parts or incrementally factorize the matrix so that the memory usage can be kept down?
Thanks in advance
  1 Comment
Joss Knight
Joss Knight on 12 Oct 2015
Do you really need LU, or are you just solving systems of equations? pagefun supports mldivide, which you can use to do that (and which does LU under the hood).

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!