How to perform Eigenvalue Decomposition e.g, eig() on multiple GPUs?

조회 수: 12 (최근 30일)
matlabnsd sun
matlabnsd sun 2023년 5월 2일
답변: Joss Knight 2023년 5월 7일
Since the matrix is very large,about 60kx60k herimitian matrix.
If do eig(), it needs about 140G memory and exceeds a single GPU's memory, normally is 24G or 40G.

답변 (3개)

Walter Roberson
Walter Roberson 2023년 5월 2일
That is not possible.
The current status of support for splitting work across GPUs is described at https://www.mathworks.com/help/parallel-computing/run-matlab-functions-on-multiple-gpus.html#MultiGPUExample-4
The last time I saw staff mentioning this possibility, it was really only for some aspects of Deep Learning. The current documentation hints it might be a bit more flexible now.
I doubt that it will work for your purpose, but I do not know enough about it to be sure of that.

Steven Lord
Steven Lord 2023년 5월 2일
Do you need all the eigenvalues and eigenvectors or do you just need a few of them? If the latter, consider using the eigs function instead of eig, perhaps (if your matrix has some structure that you can exploit) using the Afun syntax to avoid explicitly creating that huge matrix.

Joss Knight
Joss Knight 2023년 5월 7일
eigendecomposition is a highly serial algorithm so that's why simple multi-process solutions aren't easy to find and why the GPU's performance against the CPU does not compare particularly well to other LAPACK algorithms.
However, MATLAB is a programming language with a rich parallel language, so anything that is possible is possible in MATLAB.
It's plausible that using a distributed array and forgetting about GPUs will be your best best for now.

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by