Multithread in sparse matrix multiplication with full matrix

조회 수: 5 (최근 30일)
Jiaen Liu
Jiaen Liu 2023년 5월 13일
편집: Bruno Luong 2023년 8월 4일
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