필터 지우기
필터 지우기

speed up computation of huge matrix?

조회 수: 6 (최근 30일)
Leon
Leon 2011년 10월 14일
Hi,
I need to compute the mean of a huge matrix (20000*20000*time) at several times, Is there any way to speed up the computation when calculating this?
Cheers

답변 (4개)

Jan
Jan 2011년 10월 14일
Yes, or no. It depends.
An arry of the size [20000 x 20000 x time] occupies 3.2 GB, if time is 1 and for type DOUBLE. If time is larger, more memory is needed - in contiguous free blocks.
Calculating the MEAN over the 1st dimension is much faster than over the 2nd one, because the memory is processed in contiguos blocks.
Using INT16 values would reduce the memory footprint, but the values must be integer then.
Without any more detailed description, a more specific answer is impossible.

Edric Ellis
Edric Ellis 2011년 10월 14일
As Jan points out, this is very large data. One option is to use distributed arrays with Parallel Computing Toolbox (and MATLAB Distributed Computing Server to spread the computation over the memory of multiple machines). But it may be better yet not to have all of your data in memory at one time.
If you have a capable GPU, you can use gpuArrays. On my NVIDIA C1060, I can calculate the mean of 20000x20000 doubles in 0.04 seconds vs. 0.2 seconds on my CPU (R2011b). A more recent Tesla card such as the C20xx family would probably out-perform this.
  댓글 수: 5
Edric Ellis
Edric Ellis 2011년 10월 17일
Building a 3.2GB gpuArray from a CPU array takes about 2.0 seconds on my system. This is why it's important to keep data on the GPU as long as possible, and preferably build it there (there are zeros/ones etc. functions which can build a 3.2GB gpuArray in 0.025 seconds; rand on the GPU is somewhat slower, but still quicker than building on the host and transferring).
Jan
Jan 2011년 10월 17일
@Edric: Thanks for this summary. I've upgraded from a Pentium-M to a dual-core some month ago. Now my experiments with mutli-threading are less abstract. CUDA is the next step.

댓글을 달려면 로그인하십시오.


park minah
park minah 2011년 10월 14일
I think you'd better use 'parallel computing'. It will be make your process speedy, maybe.

Thomas
Thomas 2011년 10월 21일
Use a GPU card and gpuArray. Our Tesla M2070-Q (448 cores, 6GB) performs this in 0.02125 sec.
I have performed a similar (50000*50000) *100 in less than 2 seconds..

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by