How to improve speed of execution for huge matrix multiplication ?
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone, I am currently working on a neural project in which I need to handle a lot of data. The goal is to minimize this function :
Variables : N = 10 000 000 C = 500 A = vecteur (100, 1) W = matrice (100,100) B = vecteur (100,1)
The problem is that I can't optimize directly this function. Indeed, even if I can make the multiplication in 1e-6s, I would need 500*10000000=5e3s for one step. Thus, I have to vectorize the problem, which is possible in this case. Instead of having a matrix A (100,1), I can transform it to A (100,10000000). The function to minimize become :
If A is a matrix of singles (100,10000000), it means there are 1e9 elements. Each element is coded on 4 bytes. To store this kind of matrix, I would need 4GB of RAM.
Of course, my computer (6GB, 4cores) is not going to handle this type of problem so I thought about cloud computing. I think I should benefit from multiple cores computer (~30) with a big amount of RAM (~200 GB) to parallelize the execution of the function. Do you think I am doing it the right way or should I use GPU calculation instead for example ? If you have any suggestions, please let me know. Thanks in advance.
0 个评论
回答(1 个)
Farouk Moukaddem
2016-9-19
Hi Edouard,
Refer to the following documentation link for the best practices to improve the performance of code: http://www.mathworks.com/help/matlab/matlab_prog/techniques-for-improving-performance.html
Thanks,
Farouk
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!