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

24 次查看(过去 30 天)
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