Using Ensemble Learning to Improve Automatic Vectorization of Tensor Contraction Program
Automatic vectorization is crucial for improving the performance of computationally intensive programs. Existing compilers use conservative optimization strategies for automatic vectorization, which, in many cases, lead to the loss of vectorization opportunity. Studies have shown that the use of mac...
Main Authors: | , , |
---|---|
Format: | Article |
Language: | English |
Published: |
IEEE
2018-01-01
|
Series: | IEEE Access |
Subjects: | |
Online Access: | https://ieeexplore.ieee.org/document/8445573/ |
id |
doaj-cd4a19c1313a4644b5c7cb7fb43c17c7 |
---|---|
record_format |
Article |
spelling |
doaj-cd4a19c1313a4644b5c7cb7fb43c17c72021-03-29T21:11:58ZengIEEEIEEE Access2169-35362018-01-016471124712410.1109/ACCESS.2018.28671518445573Using Ensemble Learning to Improve Automatic Vectorization of Tensor Contraction ProgramHui Liu0https://orcid.org/0000-0002-9607-8069Rongcai Zhao1Kai Nie2State Key Laboratory of Mathematical Engineering and Advanced Computing, PLA Information Engineering University, Zhengzhou, ChinaState Key Laboratory of Mathematical Engineering and Advanced Computing, PLA Information Engineering University, Zhengzhou, ChinaState Key Laboratory of Mathematical Engineering and Advanced Computing, PLA Information Engineering University, Zhengzhou, ChinaAutomatic vectorization is crucial for improving the performance of computationally intensive programs. Existing compilers use conservative optimization strategies for automatic vectorization, which, in many cases, lead to the loss of vectorization opportunity. Studies have shown that the use of machine learning algorithms to build a performance prediction model is beneficial to improve the program performance. The model input is program features, and the output is the predicted optimization strategies or the program performance related to the optimization. In this paper, we focus on a computational intensive loop structure-tensor contraction, which is common in quantum chemical simulations. Most existing machine learning methods rely on control and data flow graphs as features to represent programs, but different tensor contraction kernels have the same control and data flow graphs. In addition, the existing methods often use the same kind of learning algorithm to construct a learning model, which is prone to overfitting and low-precision problems. In this paper, we propose an automatic vectorization performance enhancement method based on ensemble learning. We construct an ensemble learning model to predict the performance of tensor contraction kernels with different vectorization strategies and select the best vectorization strategy for the kernels. According to the storage access patterns of the tensor contraction kernels, we propose a static method for features representation. Based on the multi-algorithm ensemble learning strategy, we obtain better learning results than the single learning algorithm. The experimental results show that the prediction model achieves 88% and 87% prediction efficiency on two different platforms with different instruction sets, data types, and compilers. Compared with the existing methods, the prediction efficiency is greatly improved. In addition, the average peak performance is 2.96× of Intel ICC 12.0 and 2.98× of GCC 4.6 compiler, respectively.https://ieeexplore.ieee.org/document/8445573/Automatic vectorizationcompiler optimizationensemble learningprogram features |
collection |
DOAJ |
language |
English |
format |
Article |
sources |
DOAJ |
author |
Hui Liu Rongcai Zhao Kai Nie |
spellingShingle |
Hui Liu Rongcai Zhao Kai Nie Using Ensemble Learning to Improve Automatic Vectorization of Tensor Contraction Program IEEE Access Automatic vectorization compiler optimization ensemble learning program features |
author_facet |
Hui Liu Rongcai Zhao Kai Nie |
author_sort |
Hui Liu |
title |
Using Ensemble Learning to Improve Automatic Vectorization of Tensor Contraction Program |
title_short |
Using Ensemble Learning to Improve Automatic Vectorization of Tensor Contraction Program |
title_full |
Using Ensemble Learning to Improve Automatic Vectorization of Tensor Contraction Program |
title_fullStr |
Using Ensemble Learning to Improve Automatic Vectorization of Tensor Contraction Program |
title_full_unstemmed |
Using Ensemble Learning to Improve Automatic Vectorization of Tensor Contraction Program |
title_sort |
using ensemble learning to improve automatic vectorization of tensor contraction program |
publisher |
IEEE |
series |
IEEE Access |
issn |
2169-3536 |
publishDate |
2018-01-01 |
description |
Automatic vectorization is crucial for improving the performance of computationally intensive programs. Existing compilers use conservative optimization strategies for automatic vectorization, which, in many cases, lead to the loss of vectorization opportunity. Studies have shown that the use of machine learning algorithms to build a performance prediction model is beneficial to improve the program performance. The model input is program features, and the output is the predicted optimization strategies or the program performance related to the optimization. In this paper, we focus on a computational intensive loop structure-tensor contraction, which is common in quantum chemical simulations. Most existing machine learning methods rely on control and data flow graphs as features to represent programs, but different tensor contraction kernels have the same control and data flow graphs. In addition, the existing methods often use the same kind of learning algorithm to construct a learning model, which is prone to overfitting and low-precision problems. In this paper, we propose an automatic vectorization performance enhancement method based on ensemble learning. We construct an ensemble learning model to predict the performance of tensor contraction kernels with different vectorization strategies and select the best vectorization strategy for the kernels. According to the storage access patterns of the tensor contraction kernels, we propose a static method for features representation. Based on the multi-algorithm ensemble learning strategy, we obtain better learning results than the single learning algorithm. The experimental results show that the prediction model achieves 88% and 87% prediction efficiency on two different platforms with different instruction sets, data types, and compilers. Compared with the existing methods, the prediction efficiency is greatly improved. In addition, the average peak performance is 2.96× of Intel ICC 12.0 and 2.98× of GCC 4.6 compiler, respectively. |
topic |
Automatic vectorization compiler optimization ensemble learning program features |
url |
https://ieeexplore.ieee.org/document/8445573/ |
work_keys_str_mv |
AT huiliu usingensemblelearningtoimproveautomaticvectorizationoftensorcontractionprogram AT rongcaizhao usingensemblelearningtoimproveautomaticvectorizationoftensorcontractionprogram AT kainie usingensemblelearningtoimproveautomaticvectorizationoftensorcontractionprogram |
_version_ |
1724193347332997120 |