Question

I'm looking for a way to find the pseudo-inverse of a matrix so it can be done on the GPU. SVD/QR are difficult to parallelize and are not supported but MATLAB's GPU, but it seems that LU, though can be run in parallel is not supported by MATLAB's GPU as well. I compared performance and it seems to be slower than running on a single core CPU.

I am looking for a pseudo inverse (or even a regular inverse for square matrices) that I can use. According to Matlab, using mldivide () performs Gauss elimination which is applicable for GPUs.

I tried using A\I but unfortunately it does not run efficiently on GPUs.

Does anyone can direct me to an optimized code for parallel LU or Gaussian elimination?

I heard of the MAGMA package, but it seems a lot of work to install and to compile and I really need this simple thing.

A C++ code is also welcome.

Thanks, Gil

Was it helpful?

Solution

In MATLAB R2013a, LU, QR and SVD are all supported on the gpu through gpuArray. There's a list of supported functions here: http://www.mathworks.co.uk/help/distcomp/using-gpuarray.html#bsloua3-1 . The linear algebra functions of gpuArray are all implemented using MAGMA.

A\b can run efficiently on the GPU, see this example: http://www.mathworks.co.uk/help/distcomp/examples/benchmarking-a-b-on-the-gpu.html . As the problem size increases, you can expect a decently powerful GPU (e.g. Tesla) to run up to 5 times faster than the CPU.

OTHER TIPS

This article MATRIX INVERSION SPEED UP WITH CUDA may help:

ABSTRACT In this project several mathematic algorithms are developed to obtain a matrix inversion method - that combines CUDA’s parallel architecture and MATLAB – which is actually faster than MATLAB’s built in inverse matrix function. This matrix inversion method is intended to be used for image reconstruction as a faster alternative to iterative methods with a comparable quality. The algorithms developed in this project are Gauss-Jordan elimination, Cholesky decomposition, Gaussian elimination and matrix multiplication.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top