arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.19350cs.PL
收藏

Transform Dialect 教程

Transform Dialect Tutorial

Oleksandr Zinenko

AI总结:

本文介绍 MLIR 的 Transform Dialect,它通过 transform IR 引导 payload IR 的细粒度变换,支持对特定 IR 对象进行选择性优化,是对现有 pass 和模式重写基础设施的补充。

摘要:

MLIR 中的 Transform Dialect 提供了一组操作,可用于通过 IR 的另一部分来控制中间表示(IR)的变换。它将被变换的 IR 称为 payload IR,将引导变换的 IR 称为 transform IR。该 dialect 的主要用例是在单个 IR 对象(操作或值)或其集合上编排细粒度变换。例如,它可能涉及在 payload IR 中查找具有特定属性(如较大规模)的类循环操作,仅对这些操作应用循环分块(loop tiling),然后对先前变换产生的内层循环应用循环展开(loop unrolling)。因此,它并非旨在替代 pass 基础设施,也不是为了替代模式重写基础设施。在最常见的情况下,transform IR 将由一个 pass 处理并应用到 payload IR 上。由 Transform dialect 表达的变换可以使用模式基础设施或任何其他相关的 MLIR 组件来实现。本文档的其余部分将结合结构化操作解释 MLIR Transform Dialect 的主要概念和使用场景。

英文摘要:

Transform Dialect in MLIR provides operations that can be used to control transformation of the Intermediate Representation (IR) using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual IR objects (operations or values) or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to the payload IR by a pass. Transformations expressed by the Transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. The rest of this document explains the main concepts and usage scenario of the MLIR Transform Dialect combined with structured operations.

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

↑