Font Size: a A A

Research On Heuristic Optimization Of OpenCL Program Based On Graph Network

Posted on:2021-05-08Degree:MasterType:Thesis
Country:ChinaCandidate:Z K HeFull Text:PDF
GTID:2428330611457095Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
General-purpose computing such as 3D image processing,video processing,etc.require higher and higher GPU performance,and heterogeneous devices have developed rapidly.The traditional programming model under the heterogeneous platform has the problems of poor portability and low compatibility.Apple has developed a framework aimed at heterogeneous computing platforms OpenCL.Although the OpenCL programming model can reduce the difficulty of programming to a certain extent,when writing high-performance general-purpose computing programs,you still need to consider how to use optimization methods to get shorter execution time and higher acceleration ratio.To improve the execution efficiency of OpenCL code,at present,academic and industrial circles have proposed solutions such as the use of machine learning for kernel parameter self-tuning and heuristic program optimization.However,the current method has the problem that there are many manual interventions and LSTM is not suitable for processing non-Euclidean structure data.Therefore,this paper proposes an OpenCL heuristic program optimization scheme based on the graph network.It achieves the goals of reducing program execution time and improving program acceleration ratio by completing two tasks of optimal mapping of heterogeneous devices and prediction of optimal thread coarsening factor.The research work of this paper includes three aspects:(1)Aiming at the current coding method only considering the shallow sequential text structure information of the code,research,and design an LLVM-based OpenCL source code composition method.After simplifying the code and removing redundant information in the pre-processing stage,seven edges are constructed from the obtained abstract syntax tree,which aims to summarize the syntax and semantic information of the source code as much as possible.The seven edges are divided into three types: abstract syntax tree edge,syntax information edge,and semantic information edge.(2)Aiming at the problem that LSTM is not suitable for processing non-Euclidean structure data,a heuristic optimization method based on graph network is researched anddesigned.Use word2 vec to learn the context and type information of token,normalize to scale auxiliary items such as work items,based on RGCN and GNN,a graph neural network RGNN based on edge type is proposed,and the automatic extraction of code features is completed through RGNN,and then completed Heterogeneous parallel mapping tasks.(3)Aiming at the problems that the OpenCL coarsened data set is difficult to get and there are many manual interventions,a heuristic optimization method based on transfer learning is studied and designed.After removing redundant information,we generate many OpenCL codes as a training set,and we perform migration learning on the models learned in the heterogeneous parallel mapping task.We achieve the task migration while retaining the source code composition and graph neural network layer.The thread coarsening factor prediction task is completed under the platform.The experimental results show that in the heterogeneous parallel mapping task,the optimization method in this paper can achieve a recognition rate of 88.50% in the best case,which improves the performance by 20.8% compared with the most advanced method.In the thread coarsening task,the best case can achieve a speedup of 1.14 times,compared with the most advanced method,it improves the performance by 10.6%.
Keywords/Search Tags:program optimization, graph network, OpenCL, transfer learning, LLVM
PDF Full Text Request
Related items