用深度学习自动识别代码中可并行的循环,提升软件性能优化效率。
Discovering Software Parallelization Points Using Deep Neural Networks
- 基于遗传算法生成两类代码:可并行和依赖模糊的循环
- CNN模型平均表现略优于DNN,两者波动相似
- 数据多样性对模型性能至关重要,适合编译器与性能优化研究者
本研究提出一种基于深度学习的方法,用于识别程序代码中具有并行化潜力的循环。通过遗传算法生成两类代码:(i) 独立循环(可并行),(ii) 依赖关系不明确的模糊循环(无法判断是否可并行)。生成的代码片段经分词与预处理形成稳健数据集。采用深度神经网络(DNN)与卷积神经网络(CNN)进行分类。基于30次独立实验的统计分析验证了模型性能,结果显示CNN平均表现略优,但两模型方差相近。不同数据规模的实验表明,数据多样性对模型表现至关重要。结果证明了利用深度学习自动化识别代码并行结构的可行性,为软件优化与性能提升提供了有力工具。
原文摘要 · Abstract (English)
This study proposes a deep learning-based approach for discovering loops in programming code according to their potential for parallelization. Two genetic algorithm-based code generators were developed to produce two distinct types of code: (i) independent loops, which are parallelizable, and (ii) ambiguous loops, whose dependencies are unclear, making them impossible to define if the loop is parallelizable or not. The generated code snippets were tokenized and preprocessed to ensure a robust dataset. Two deep learning models - a Deep Neural Network (DNN) and a Convolutional Neural Network (CNN) - were implemented to perform the classification. Based on 30 independent runs, a robust statistical analysis was employed to verify the expected performance of both models, DNN and CNN. The CNN showed a slightly higher mean performance, but the two models had a similar variability. Experiments with varying dataset sizes highlighted the importance of data diversity for model performance. These results demonstrate the feasibility of using deep learning to automate the identification of parallelizable structures in code, offering a promising tool for software optimization and performance improvement.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。