Modeling Layout Abstractions Using Integer Set Relations
Somashekaracharya G Bhaskaracharya, Aravind Acharya, Bastian Hagedorn, Vinod Grover
现代深度学习编译器依靠布局抽象来管理逻辑张量结构和物理内存排列之间的复杂映射。 CuTe布局和Triton线性布局是广泛采用的行业标准。 然而,这些布局系统以不同的数学基础独立运作,阻止了统一的正式分析和跨系统推理。 我们通过引入一种新颖的方法弥合这一差距,该方法利用整数集库(ISL)通过整数集关系为两个布局系统创建统一的数学表示,从而实现严格的形式分析,正确性验证以及未来跨系统优化策略的基础。 我们的方法通过整数集关系对CuTe布局进行布局,这些关系使用基于步幅的计算来编码从多维坐标到线性索引的变换,包括复杂的swizzle操作,执行位级操作,以增强内存访问模式。 对于 Triton 线性布局,我们构建整数集关系,对二进制向量空间变换进行建模,其中算术运算遵循有限字段 F_2 规则。 我们实现了一套完整的布局操作算法,用于组成,反转,使用ISL中的内置操作进行补充,以确保数学正确性并保留布局语义。 实验评估表明,该系统处理布局复杂性的全谱,从基本身份转换到复杂的多维张量安排,具有复杂的步幅配置和摆动模式,验证了跨不同布局范式的数学建模方法。
Modern deep learning compilers rely on layout abstractions to manage the complex mapping between logical tensor structures and physical memory arrangements. CuTe layouts and Triton linear layouts are widely adopted industry standards. However, these layout systems operate independently with distinct mathematical underpinnings, preventing unified formal analysis and cross-system reasoning. We bridge this gap by introducing a novel approach that leverages the Integer Set Library (ISL) to create a ...