arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1909.06228cs.PLcs.LGcs.NEcs.SE
收藏

IR2Vec:基于LLVM IR的可扩展程序嵌入

IR2Vec: LLVM IR based Scalable Program Embeddings

Indian Institute of Technology Hyderabad(印度理工学院海得拉巴分校);Indian Institute of Science(印度科学学院)

S. VenkataKeerthy, Rohit Aggarwal, Shalini Jain, Maunendra Sankar Desarkar, Ramakrishna Upadrasta, Y. N. Srikant

摘要:

我们提出了IR 2 Vec,一个简洁和可扩展的编码基础设施来表示程序作为一个分布式嵌入在连续空间。这种分布式嵌入是通过将表示学习方法与流信息相结合来捕获输入程序的语法和语义而获得的。由于我们的基础设施是基于中间表示(IR)的源代码,所获得的嵌入是语言和机器无关的。IR的实体被建模为关系,并且它们的表示被学习以形成种子嵌入词汇表。使用这个基础设施,我们提出了两个增量编码:符号和流量感知。符号编码是从种子嵌入词汇表中获得的,而流感知编码是通过用流信息增强符号编码来获得的。我们展示了我们的方法在两个优化任务(异构设备映射和线程粗化)的有效性。我们表示程序的方式使我们能够使用非顺序模型,从而使训练时间更快。IR 2 Vec生成的两种编码在两个任务中都优于现有方法,即使使用简单的机器学习模型。特别是,我们的结果提高或匹配的最先进的加速在11/14基准套件的设备映射任务在两个平台和53/68基准线程粗化任务在四个不同的平台。与其他方法相比,我们的嵌入更具可扩展性,不需要数据,并且具有更好的词汇表外(OOV)特性。

英文摘要:

We propose IR2Vec, a Concise and Scalable encoding infrastructure to represent programs as a distributed embedding in continuous space. This distributed embedding is obtained by combining representation learning methods with flow information to capture the syntax as well as the semantics of the input programs. As our infrastructure is based on the Intermediate Representation (IR) of the source code, obtained embeddings are both language and machine independent. The entities of the IR are modeled as relationships, and their representations are learned to form a seed embedding vocabulary. Using this infrastructure, we propose two incremental encodings:Symbolic and Flow-Aware. Symbolic encodings are obtained from the seed embedding vocabulary, and Flow-Aware encodings are obtained by augmenting the Symbolic encodings with the flow information. We show the effectiveness of our methodology on two optimization tasks (Heterogeneous device mapping and Thread coarsening). Our way of representing the programs enables us to use non-sequential models resulting in orders of magnitude of faster training time. Both the encodings generated by IR2Vec outperform the existing methods in both the tasks, even while using simple machine learning models. In particular, our results improve or match the state-of-the-art speedup in 11/14 benchmark-suites in the device mapping task across two platforms and 53/68 benchmarks in the Thread coarsening task across four different platforms. When compared to the other methods, our embeddings are more scalable, is non-data-hungry, and has betterOut-Of-Vocabulary (OOV) characteristics.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑