Azzera filtri
Azzera filtri

Multithread in sparse matrix multiplication with full matrix

6 visualizzazioni (ultimi 30 giorni)
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 Commento
Bruno Luong
Bruno Luong il 4 Ago 2023
Modificato: Bruno Luong il 4 Ago 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.

Accedi per commentare.

Risposte (1)

Vinayak
Vinayak il 4 Ago 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.

Categorie

Scopri di più su Sparse Matrices in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by