Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: speeding up floating point operations
Date: Tue, 12 May 2009 11:24:02 +0000 (UTC)
Organization: UNIVERSITE AIX MARSEILLE 2
Lines: 34
Message-ID: <gubm8i$3bc$1@fred.mathworks.com>
References: <gu2c2m$mup$1@fred.mathworks.com> <gu2kj1$ea8$1@fred.mathworks.com> <gu7iul$cut$1@fred.mathworks.com> <gu9rhq$plj$1@fred.mathworks.com> <gu9vud$nek$1@fred.mathworks.com> <gua2gt$j1q$1@fred.mathworks.com> <gua9ni$e9h$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1242127442 3436 172.30.248.37 (12 May 2009 11:24:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 12 May 2009 11:24:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 870049
Xref: news.mathworks.com comp.soft-sys.matlab:539210


Have a look to :

http://wwwuser.gwdg.de/~mleuten/MATLABToolbox/index.html

Regards,

Sebastien

"James Tursa" <aclassyguywithaknotac@hotmail.com> wrote in message <gua9ni$e9h$1@fred.mathworks.com>...
> "NIcholas " <remove.this_nmg33@cornell.edu> wrote in message <gua2gt$j1q$1@fred.mathworks.com>...
> > 
> > I am currently using single precision matrix mult and my data (input and output) is in single and it is almost 2x as quick as double.  Is the MATLAB '*' operator on singles calling the optimized BLAS SGEMM that you are referring to?
> 
> Yes. The MATLAB intrinsic * operator for single class variables is calling the BLAS SGEMM routine in the background to do the work (using whatever library you have connected to MATLAB, e.g. your Intel MKL). So you are already getting the max speedup here. To check this I wrote a mex routine that called SGEMM directly and got the same timing results as the MATLAB intrinsic *.
> 
> MATLAB recently changed vendors for their BLAS / LAPACK libraries. I did a test case and found that a large matrix multiply that took 6.5 seconds in R2007a was only taking 2.6 seconds in R2008b. So results for these operations are very critically dependent on the particular BLAS / LAPACK library you are using.
> 
> >  Also, I have a dual core processor and have enabled multithreading (about 1.7x speedup for matrices i'm working with).
> > 
> 
> I am not sure if the MKL version you are using takes advantage of this. You might read the doc to see.
> 
> > I just found that some MKL operations allow control of precision - 
> > http://www.intel.com/software/products/mkl/data/vml/vmldata.htm - but I'm not sure if this is just for vector operations (like sqrt, acos, etc.) or if there is a way to set low precision for operations like matrix multiply.  I am asking if there was a similar flag to be set in MATLAB or if it is possible to set such a flag for ops like mat mult.
> > 
> 
> I doubt it. For functions like sqrt or acos that iterate, I guess I could see there being a user-settable flag that stops the iteration process before max precision has been achieved, but for something as basic as multiplication I just can't imagine there being an equivalent.
> 
> > The reason I am asking is I have a very intensive compuation where essentially all the time is spent doing a matrix mult but the result only needs a few decimal digits of accuracy.  So any small speedup in this operation would speed up my entire computation.
> > 
> 
> I think you are stuck, unless you can reformulate your problem. Wish I could help you more.
> 
> James Tursa