Multithread in sparse matrix multiplication with full matrix

8 次查看(过去 30 天)
From a few years ago, I have to implement MKL to speed up sparse matrix multiplication with full matrix with multithread in MATLAB. I'm wondering why it's not part of MATLAB's functionality. The current approach is still single threaded. Maybe I missed some settings.
Thanks
Jiaen
  1 个评论
Bruno Luong
Bruno Luong 2023-8-4
编辑:Bruno Luong 2023-8-4
+1.
The pattern (sparse * full) is not uncommon usecase. TMW definitively have to optimize it.
I don't know what is MKL, but I think they can certainly multithreaded it without the need of external library.

请先登录,再进行评论。

回答(1 个)

Vinayak
Vinayak 2023-8-4
Hi Jiaen,
The reason for this is that MATLAB aims to provide a general-purpose environment with a wide range of functionality, catering to various domains and use cases. While MATLAB does optimize its built-in functions for performance, it may not always incorporate specific external libraries like MKL for every operation.
However, MATLAB does provide an interface called the MATLAB External Interfaces/API, which allows you to integrate external libraries and languages, including MKL, into MATLAB. By creating a MEX-file (MATLAB Executable), you can write custom code in C/C++ that utilizes MKL for sparse matrix multiplication with multithreading, and then interface it with MATLAB.
It's worth noting that MATLAB's performance can still be improved by utilizing parallel computing techniques, such as parallel for-loops, parfor, or GPU computing, depending on the characteristics of your problem and available resources.
Hope it helps.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by