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

TileLang:一种面向AI系统的可组合分块编程模型

TileLang: A Composable Tiled Programming Model for AI Systems

Peking University(北京大学);Imperial College London(伦敦帝国学院);Microsoft Research(微软研究院)

Lei Wang, Yu Cheng, Yining Shi, Zhengju Tang, Zhiwen Mo, Wenhao Xie, Lingxiao Ma, Yuqing Xia, Jilong Xue, Fan Yang, Zhi Yang

AI总结:

针对高性能AI内核编写复杂且现有编译器在可用性与表达性上存在不足的问题,提出TileLang分块编程模型,将调度空间与数据流解耦并封装为注解和原语,在关键内核上实现了最先进的性能。

摘要:

现代AI工作负载在训练和推理中都严重依赖优化的计算内核。这些AI内核遵循定义良好的数据流模式,例如在DRAM和SRAM之间移动分块,并对这些分块执行一系列计算。然而,尽管这些模式很清晰,编写高性能内核仍然很复杂。实现峰值性能需要仔细的、以硬件为中心的优化,以充分利用现代加速器。虽然领域特定编译器试图减轻编写高性能内核的负担,但它们通常在可用性和表达性方面存在差距。在本文中,我们提出了TileLang,一种用于更高效AI内核编程的通用分块编程模型。TileLang将调度空间(线程绑定、布局、张量化和流水线)与数据流解耦,并将它们封装为一组自定义注解和原语。这种方法允许用户专注于内核的数据流本身,而将大多数其他优化留给编译器。我们在常用设备上进行了全面实验,评估表明TileLang可以在关键内核中实现最先进的性能,这表明其统一的块和线程范式以及透明的调度能力提供了现代AI系统开发所需的强大功能和灵活性。

英文摘要:

Modern AI workloads rely heavily on optimized computing kernels for both training and inference. These AI kernels follow well-defined data-flow patterns, such as moving tiles between DRAM and SRAM and performing a sequence of computations on those tiles. However, writing high-performance kernels remains complex despite the clarity of these patterns. Achieving peak performance requires careful, hardware-centric optimizations to fully leverage modern accelerators. While domain-specific compilers attempt to reduce the burden of writing high-performance kernels, they often struggle with usability and expressiveness gaps. In this paper, we present TileLang, a generalized tiled programming model for more efficient AI Kernel programming. TileLang decouples scheduling space (thread binding, layout, tensorize and pipeline) from dataflow, and encapsulated them as a set of customization annotations and primitives. This approach allows users to focus on the kernel's data-flow itself, while leaving most other optimizations to compilers. We conduct comprehensive experiments on commonly-used devices, across numerous experiments, our evaluation shows that TileLang can achieve state-of-the-art performance in key kernels, demonstrating that its unified block-and-thread paradigm and transparent scheduling capabilities deliver both the power and flexibility demanded by modern AI system development.

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

↑