Re: question about CUDA
- To: mathgroup at smc.vnet.net
- Subject: [mg115689] Re: question about CUDA
- From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
- Date: Tue, 18 Jan 2011 05:51:38 -0500 (EST)
If this is the case then it sounds as it is parallelizable with CUDA. It is important, that the "work which is done faster in parallel amortizes the overhead which is required to distribute the work on the parallel processors and to collect the results later." So doing something like result[i][j][k] = i+j+k; on each process is far too less work to have a speed up. So if you try to do something like result[i][j][k] = fulfillsTheEquation(i,j,k); with a very short fulfillsTheEquation then it's maybe better to parallelize only 2 of the loops and calculate on each parallel process something like for ($k=1; $k<1000; $k++) result[i][j][k] = fulfillsTheEquation(i,j,k); All this stuff is not explained in 5 minutes and never in one email. It depends on your exact algorithm. Cheers Patrick On Mon, 2011-01-17 at 21:03 +0300, Ivan Smirnov wrote: > What if we want to parallel such type of algorithm: > for ($i=1; $i<1000; $i++) > for ($j=1; $j<1000; $j++) > for ($k=1; $k<1000; $k++) > { > ... > } > There is a domain in which there are independent combinations of > i,j,k, that can be checked in parallel. This is a brute force search. > Can we use CUDA for this? The idea is that each processor searches for > the solution in its small part of this domain. > > 2011/1/17 Patrick Scheibe <pscheibe at trm.uni-leipzig.de> > Sorry, > > I'm not up-to-date with the currently used methods. You'll > have to check > the literature about that. > > Cheers > Patrick > > > On Mon, 2011-01-17 at 19:12 +0300, Ivan Smirnov wrote: > > Can you see then any ways to boost performance with CUDA for > searching > > of possible solutions of any diophantine equations with > powers? > > > > 2011/1/17 Patrick Scheibe <pscheibe at trm.uni-leipzig.de> > > Hi, > > > > this is not possible for one obvious and several > other > > reasons. > > The obvious one is, that it is not implemented and > *maybe* > > will never be > > for several reasons. > > You cannot think of CUDA as some kind of extension > which > > allows you to > > run Mathematica code on the faster graphics card. > Every > > function has to > > be separately implemented for CUDA. > > > > The version 8 Mathematica has several function which > use CUDA, > > mainly > > for image processing and for matrix operations. Find > an > > overview in the > > doc-center here > > > > CUDALink/guide/CUDALink > > > > CUDA is best used for highly "data-parallel" > algorithms [1] > > which is, as > > far as I can say, not the case for Solve. > > > > Cheers > > Patrick > > > > [1] http://en.wikipedia.org/wiki/Data_parallelism > > > > > > > > On Mon, 2011-01-17 at 18:56 +0300, Ivan Smirnov > wrote: > > > Patrick, thanks for answer. I have such thoughts. > > > Can you say, what additional code is needed to run > Solve > > command in > > > Mathematica 8 with CUDA? > > > > > > 2011/1/17 Patrick Scheibe > <pscheibe at trm.uni-leipzig.de> > > > Hi, > > > > > > no, this is not true. You can use CUDA > enabled cards > > for > > > computations > > > even if this is the only card in the > system. It > > should be > > > clear, that > > > then some resources of your graphics card > may be > > used by other > > > applications currently running. Another > thing is > > that your > > > CUDA program > > > may use too much memory or has too many > bugs and > > crashes your > > > system.. > > > this is the point where a second card > become handy. > > For now, > > > leave it > > > like that and start playing with CUDA. The > > specification of > > > your card > > > here > > > > > > > > > http://www.nvidia.com/object/product_geforce_8800_gt_us.html > > > > > > shows that you have 112 CUDA Cores and 512 > MB Ram, > > which is > > > fine to see > > > the magic. > > > > > > Cheers > > > Patrick > > > > > > > > > > > > On Mon, 2011-01-17 at 05:36 -0500, Ivan > Smirnov > > wrote: > > > > Hello. > > > > I'm planning to start using CUDA. > > > > If I have 8800GT card (it supports > CUDA), can I > > start use > > > CUDA computations > > > > in Mathematica 8 with just this card or > I need > > install one > > > more card in that > > > > PC? (I heard that one man said that > supposedly > > there are > > > needed 2 or more > > > > cards as CUDA are parallel computations > - is it > > true?). > > > > > > > > Ivan Smirnov > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >