Multithread in sparse matrix multiplication with full matrix

5 visualizaciones (últimos 30 días)
Jiaen Liu
Jiaen Liu el 13 de Mayo de 2023
Editada: Bruno Luong el 4 de Ag. de 2023
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 comentario
Bruno Luong
Bruno Luong el 4 de Ag. de 2023
Editada: Bruno Luong el 4 de Ag. de 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.

Iniciar sesión para comentar.

Respuestas (1)

Vinayak
Vinayak el 4 de Ag. de 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.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by