Elegante: A Machine Learning-Based Threads Configuration Tool for SpMV Computations on Shared Memory Architecture
The sparse matrix–vector product (SpMV) is a fundamental computational kernel utilized in a diverse range of scientific and engineering applications. It is commonly used to solve linear and partial differential equations. The parallel computation of the SpMV product is a challenging task. Existing s...
Saved in:
| Main Authors: | , , , , , |
|---|---|
| Format: | Article |
| Language: | English |
| Published: |
MDPI AG
2024-11-01
|
| Series: | Information |
| Subjects: | |
| Online Access: | https://www.mdpi.com/2078-2489/15/11/685 |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| _version_ | 1846153405185130496 |
|---|---|
| author | Muhammad Ahmad Usman Sardar Ildar Batyrshin Muhammad Hasnain Khan Sajid Grigori Sidorov |
| author_facet | Muhammad Ahmad Usman Sardar Ildar Batyrshin Muhammad Hasnain Khan Sajid Grigori Sidorov |
| author_sort | Muhammad Ahmad |
| collection | DOAJ |
| description | The sparse matrix–vector product (SpMV) is a fundamental computational kernel utilized in a diverse range of scientific and engineering applications. It is commonly used to solve linear and partial differential equations. The parallel computation of the SpMV product is a challenging task. Existing solutions often employ a fixed number of threads assignment to rows based on empirical formulas, leading to sub-optimal configurations and significant performance losses. Elegante, our proposed machine learning-powered tool, utilizes a data-driven approach to identify the optimal thread configuration for SpMV computations within a shared memory architecture. It accomplishes this by predicting the best thread configuration based on the unique sparsity pattern of each sparse matrix. Our approach involves training and testing using various base and ensemble machine learning algorithms such as decision tree, random forest, gradient boosting, logistic regression, and support vector machine. We rigorously experimented with a dataset of nearly 1000+ real-world matrices. These matrices originated from 46 distinct application domains, spanning fields like robotics, power networks, 2D/3D meshing, and computational fluid dynamics. Our proposed methodology achieved 62% of the highest achievable performance and is 7.33 times faster, demonstrating a significant disparity from the default OpenMP configuration policy and traditional practice methods of manually or randomly selecting the number of threads. This work is the first attempt where the structure of the matrix is used to predict the optimal thread configuration for the optimization of parallel SpMV computation in a shared memory environment. |
| format | Article |
| id | doaj-art-f3913cc4b7ae44fdb76db886d24a2d34 |
| institution | Kabale University |
| issn | 2078-2489 |
| language | English |
| publishDate | 2024-11-01 |
| publisher | MDPI AG |
| record_format | Article |
| series | Information |
| spelling | doaj-art-f3913cc4b7ae44fdb76db886d24a2d342024-11-26T18:06:34ZengMDPI AGInformation2078-24892024-11-01151168510.3390/info15110685Elegante: A Machine Learning-Based Threads Configuration Tool for SpMV Computations on Shared Memory ArchitectureMuhammad Ahmad0Usman Sardar1Ildar Batyrshin2Muhammad Hasnain3Khan Sajid4Grigori Sidorov5Centro de Investigación en Computación, Instituto Politécnico Nacional (CIC-PN), Mexico City 07738, MexicoSchool of Informatics and Robotics, Institute of Arts and Culture, Lahore 54000, PakistanCentro de Investigación en Computación, Instituto Politécnico Nacional (CIC-PN), Mexico City 07738, MexicoDepartment of Computer Science, Lahore Leads University, Lahore 54000, PakistanCollege of Computer Science and Technology, Zhejiang Normal University, Jinhua 321004, ChinaCentro de Investigación en Computación, Instituto Politécnico Nacional (CIC-PN), Mexico City 07738, MexicoThe sparse matrix–vector product (SpMV) is a fundamental computational kernel utilized in a diverse range of scientific and engineering applications. It is commonly used to solve linear and partial differential equations. The parallel computation of the SpMV product is a challenging task. Existing solutions often employ a fixed number of threads assignment to rows based on empirical formulas, leading to sub-optimal configurations and significant performance losses. Elegante, our proposed machine learning-powered tool, utilizes a data-driven approach to identify the optimal thread configuration for SpMV computations within a shared memory architecture. It accomplishes this by predicting the best thread configuration based on the unique sparsity pattern of each sparse matrix. Our approach involves training and testing using various base and ensemble machine learning algorithms such as decision tree, random forest, gradient boosting, logistic regression, and support vector machine. We rigorously experimented with a dataset of nearly 1000+ real-world matrices. These matrices originated from 46 distinct application domains, spanning fields like robotics, power networks, 2D/3D meshing, and computational fluid dynamics. Our proposed methodology achieved 62% of the highest achievable performance and is 7.33 times faster, demonstrating a significant disparity from the default OpenMP configuration policy and traditional practice methods of manually or randomly selecting the number of threads. This work is the first attempt where the structure of the matrix is used to predict the optimal thread configuration for the optimization of parallel SpMV computation in a shared memory environment.https://www.mdpi.com/2078-2489/15/11/685CSRmachine learningSVMhigh-performance computingparallel computingOpenMPI |
| spellingShingle | Muhammad Ahmad Usman Sardar Ildar Batyrshin Muhammad Hasnain Khan Sajid Grigori Sidorov Elegante: A Machine Learning-Based Threads Configuration Tool for SpMV Computations on Shared Memory Architecture Information CSR machine learning SVM high-performance computing parallel computing OpenMPI |
| title | Elegante: A Machine Learning-Based Threads Configuration Tool for SpMV Computations on Shared Memory Architecture |
| title_full | Elegante: A Machine Learning-Based Threads Configuration Tool for SpMV Computations on Shared Memory Architecture |
| title_fullStr | Elegante: A Machine Learning-Based Threads Configuration Tool for SpMV Computations on Shared Memory Architecture |
| title_full_unstemmed | Elegante: A Machine Learning-Based Threads Configuration Tool for SpMV Computations on Shared Memory Architecture |
| title_short | Elegante: A Machine Learning-Based Threads Configuration Tool for SpMV Computations on Shared Memory Architecture |
| title_sort | elegante a machine learning based threads configuration tool for spmv computations on shared memory architecture |
| topic | CSR machine learning SVM high-performance computing parallel computing OpenMPI |
| url | https://www.mdpi.com/2078-2489/15/11/685 |
| work_keys_str_mv | AT muhammadahmad eleganteamachinelearningbasedthreadsconfigurationtoolforspmvcomputationsonsharedmemoryarchitecture AT usmansardar eleganteamachinelearningbasedthreadsconfigurationtoolforspmvcomputationsonsharedmemoryarchitecture AT ildarbatyrshin eleganteamachinelearningbasedthreadsconfigurationtoolforspmvcomputationsonsharedmemoryarchitecture AT muhammadhasnain eleganteamachinelearningbasedthreadsconfigurationtoolforspmvcomputationsonsharedmemoryarchitecture AT khansajid eleganteamachinelearningbasedthreadsconfigurationtoolforspmvcomputationsonsharedmemoryarchitecture AT grigorisidorov eleganteamachinelearningbasedthreadsconfigurationtoolforspmvcomputationsonsharedmemoryarchitecture |