Multithread in sparse matrix multiplication with full matrix
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Bruno Luong
le 4 Août 2023
Modifié(e) : Bruno Luong
le 4 Août 2023
+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.
Réponses (1)
Vinayak
le 4 Août 2023
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!