Paper Note: Sparse Matrix Format Selection with Multiclass SVM for SPMV on GPU

Source: Internet
Author: User
Tags svm

Original: Benatia, A., Ji, W., Wang, Y, & Shi, F. (August). Sparse Matrix Format Selection with Multiclass SVM for SPMV on GPU. In Parallel processing (ICPP), 45th International Conference on (pp. 496-505). Ieee.

SPMV (Sparse matrix-vector multiplication) refers to the operation of multiplying a sparse matrix with dense vectors. In the case of sparse matrices, dense matrices are not suitable for matrix multiplication because most of the computation and storage space is wasted on the operation of the value 0. When using sparse matrices for SPMV, its performance is affected by different sparse matrix formats and different input matrices, so for a given matrix, it is important to choose the best sparse matrix format to represent, which is also a problem to solve. The main idea of this paper is to use machine learning method to find the best representation method, first analyze some characteristics of sparse matrix, then use these features of data set to train a SVM multi-value classifier, and finally use classifier to select the appropriate sparse matrix format for a given sparse matrix.

In the experimental process, four sparse matrix formats were used: COO, CSR, ell and HYB. The COO is the most primitive form of sparse matrix storage, using three arrays to record the row, column, and numeric values of each element, which is simple, but not optimal in space. A CSR is a more commonly used format and uses three arrays, each of which is the value of each element and its corresponding column number, and an array that represents the position of the first element of a row in the list of values. The ell is to store the column number and the number with the same number of two rows as the original matrix, and the line number is represented by the row in which it is located. HYB is to solve the ell row number more when the other line of waste, hyb the extra elements with the COO stored separately.

SPMV to achieve the best performance is mainly affected by two aspects, one depends on the degree of sparse matrix, and the second is affected by different GPUs. Given a sparse matrix, choosing the most appropriate storage format on the GPU is a classification problem, which means that four formats can be considered as four categories: COO, CSR, ell, and HYB, so that the best format selection problem is transformed into a classification problem based on the sparse matrix feature. The machine learning methods used in this article are categorized in the following steps:

    1. Building Sparse matrix Datasets
    2. Extracting features
    3. Using machine learning algorithms to model on learning sets
    4. Validating on a test set
    5. Use this model to predict the best format for a given sparse matrix

The data set used in the article is University of Florida Sparse Matrix Collection, and some adjustments have been made, such as the fact that the lower COO ratio may affect the classification, and the experimental data show that the COO has little impact on the overall performance, So the data in the COO format was removed. In addition, the experiments on the data set show that the optimal format can significantly improve the performance of sparse matrices.

The characteristics are selected as follows:

For the above characteristics, the selected data set can be well covered, and the correlation between these features are relatively small, that is, each feature can reflect the matrix information. In this paper, the SVM method is used to classify the feature set, and the specific implementation is the LIBSVM. In addition, the author finds that a logarithmic transformation of the original data points makes it possible to obtain a more suitable scale. With the characteristic data, identified the classification algorithm, followed by training, the specific training process is: The matrix corresponding to the 8-dimensional feature data points and the corresponding best format tag, and then the data points are divided into 5 parts, randomly selected 80% for training, the remaining 20% to test.

Judging from the classification of the test set, the classifier has the classification accuracy of 82% and 88.5% respectively on the Gpu,fermi and Maxwell of two series. To evaluate the improvement of the classifier for optimal sparse matrix format selection, the author uses the Lub (Loss under Best) method, which measures accuracy by calculating the selection of the classifier and the average performance loss of the optimal selection. The Lub method concludes that, on the two series of GPUs, the Lub average is less than 2%, and in the worst case it will not exceed 3%. In the case where only one sparse matrix storage format is used, the classifier can increase the performance on average by 8.9% to 85.5%, and the comparison with the worst selection is more obvious. From the convergence of the classifier, Maxwell is able to converge faster than Fermi. In addition to the decision tree, the use of multi-valued SVM classifier has the best accuracy and best performance choice.

In general, the machine learning method used in this paper can achieve 98% accuracy compared to the optimal sparse matrix format, and can avoid choosing the worst format.

Paper Note: Sparse Matrix Format Selection with Multiclass SVM for SPMV on GPU

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.