arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.12470cs.LGcs.AI
收藏

用于图着色的强化学习:理解非标签不变表示的能力与局限

Reinforcement Learning for Graph Coloring: Understanding the Power and Limits of Non-Label Invariant Representations

University of Oklahoma(俄克拉荷马大学)

Chase Cummins, Richard Veras

AI总结:

本文将寄存器分配建模为图着色,并用 PPO 强化学习求解,同时通过矩阵置换实验揭示非标签不变表示会导致同一图重标后性能失效。

摘要:

寄存器分配是现代编译器中最重要的问题之一。由于用户变量的数量实际上不受限制,而 CPU 寄存器的数量很少,因此将变量无冲突地分配给寄存器是一项复杂的任务。本工作展示了如何将寄存器分配问题转化为图着色问题。借助 PyTorch 和 OpenAI Gymnasium Environments 等技术,我们将证明 Proximal Policy Optimization(近端策略优化)模型能够学习求解图着色问题。我们还将通过取图的矩阵表示并对其进行置换,证明图的标签对模型性能至关重要。随后,我们在每一种置换上测试模型的有效性,并表明当给定同一图的重新标签版本时,模型并不有效。我们的主要贡献在于表明:为了让机器学习模型获得一致的性能,需要具有标签重排不变性的图表示。

英文摘要:

Register allocation is one of the most important problems for modern compilers. With a practically unlimited number of user variables and a small number of CPU registers, assigning variables to registers without conflicts is a complex task. This work demonstrates the use of casting the register allocation problem as a graph coloring problem. Using technologies such as PyTorch and OpenAI Gymnasium Environments we will show that a Proximal Policy Optimization model can learn to solve the graph coloring problem. We will also show that the labeling of a graph is critical to the performance of the model by taking the matrix representation of a graph and permuting it. We then test the model's effectiveness on each of these permutations and show that it is not effective when given a relabeling of the same graph. Our main contribution lies in showing the need for label reordering invariant representations of graphs for machine learning models to achieve consistent performance.

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

↑