0
Résolu

How would you use mp on a GPU?

Abhranil Das il y a 7 ans mis à jour par Pavel Holoborodko il y a 7 ans 3

This page says about fast quadruple precision:


'...this allows more efficient usage of hardware capabilities of modern CPUs, even exploiting some of the advanced instructions, not to mention possibilities of harnessing power of the GPU!'

I've been trying to use mp to solve the example singular value decomposition problem (illustrated on the same page) on an NVIDIA Quadro 2000 GPU that I've successfully used MATLAB's gpu functions on. I try the following code:


mp.Digits(34); mp.GuardDigits(0); format longG
A = gpuArray.rand(1000);
X = mp(A); tic; [U,S,V] = svd(X); toc;


But on encountering line 3 MATLAB says:


Error using mp: unsupported argument type


This is probably because the argument I'm passing to mp is a GPU array that it doesn't know how to handle.


How can I get mp to do this?


À l'étude

Dear Abhranil,


Thank you for your question.


At the moment, toolbox doesn't support computations on GPU. 

The quote you mention, refers to possible merits of implementing quadruple precision computations on GPU.

But this has not been done yet.


SVD decomposition in toolbox is well optimized for parallel execution. Its performance scales almost linearly with number of CPU cores. Try using CPU with more cores. On my six-core I have got 51 seconds:


>> A = rand(1000,'mp');
>> tic; [U,S,V] = svd(A); toc;
Elapsed time is 50.972569 seconds.


What is your target usage pattern of SVD (compute just once or many times)?

Hey Pavel, thanks for your quick response.

mp functions do utilize all my cpu cores in parallel to the fullest extent. However, I am making a Mandelbrot set explorer where I need arbitrary precision beyond a zoom level, and it's much faster if I can utilize a GPU. I don't really need SVD, I was just using it as an example.

+1
Résolu

I am afraid, quality extended-precision library for GPU is non-existent. 


Toolbox provides state-of-the-art performance on CPU. Special GPU version of toolbox is under development, but there is no strict plans on its release.