Finding the best way to schedule operations in a computation graph is a classical NP-hard problem which is central to compiler optimization. However, evaluating the goodness of a schedule on the target hardware can be very time-consuming. Traditional approaches as well as previous machine learning ones typically optimize proxy metrics, which are fast to evaluate but can lead to bad schedules when tested on the target hardware. In this work, we propose a new approach to scheduling by sampling proportionally to the proxy metric using a novel GFlowNet method. We introduce a technique to control the trade-off between diversity and goodness of the proposed schedules at inference time and demonstrate empirically that the pure optimization baselines can lead to subpar performance with respect to our approach when tested on a target model. Furthermore, we show that conditioning the GFlowNet on the computation graph enables generalization to unseen scheduling problems for both synthetic and real-world compiler datasets.
翻译:在计算图中找到安排操作的最佳方法是一个古老的NP-硬性问题,这是编译器优化的关键。然而,评价目标硬件时间表的优劣可能非常耗时。传统方法以及以往的机器学习方法通常优化代理度指标,这些指标评估得很快,但在测试目标硬件时可能导致坏时间表。在这项工作中,我们提出一种新的办法,即采用一种新型的GFlowNet方法,根据代理度指标进行比例抽样。我们采用了一种技术,以控制在推断时拟议时间表的多样性和优劣之间的权衡,并用经验证明纯优化基线在测试目标模型时可导致我们方法的次优性。此外,我们显示,在计算图上对GFlowNet进行调整,可以使合成和真实世界的编译器数据集都出现看不见的列表问题。