XLA中算子融合的分析与评价
Operator Fusion in XLA: Analysis and Evaluation
摘要:
机器学习(ML)编译器是一个活跃的研究领域,因为它们提供了自动加速张量程序的潜力。核融合通常被认为是ML编译器执行的重要优化。然而,关于最常见的ML编译器XLA如何应用这种细微的优化,它可以提供什么样的加速,以及它对硬件的低级影响,存在着知识差距。本文旨在通过研究XLA源代码的关键编译通道来弥合这一知识差距。我们对强化学习环境Cartpole的评估显示了XLA在实践中如何做出不同的融合决策。此外,我们实现了几个XLA内核融合策略,可以实现高达10.56倍的加速比相比,我们的基线实现。
英文摘要:
Machine learning (ML) compilers are an active area of research because they offer the potential to automatically speedup tensor programs. Kernel fusion is often cited as an important optimization performed by ML compilers. However, there exists a knowledge gap about how XLA, the most common ML compiler, applies this nuanced optimization, what kind of speedup it can afford, and what low-level effects it has on hardware. Our paper aims to bridge this knowledge gap by studying key compiler passes of XLA's source code. Our evaluation on a reinforcement learning environment Cartpole shows how different fusion decisions in XLA are made in practice. Furthermore, we implement several XLA kernel fusion strategies that can achieve up to 10.56x speedup compared to our baseline implementation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。