Axe: A Simple Unified Layout Abstraction for Machine Learning Compilers
Bohan Hou, Hongyi Jin, Guanjie Wang, Jinqi Chen, Yaxing Cai, Lijie Yang, Zihao Ye, Yaoyao Ding, Ruihang Lai, Tianqi Chen
TL;DR
Axe introduces a simple, hardware-aware layout abstraction that maps logical tensor coordinates to a multi-axis physical space using named axes for sharding, replication, and offsets. Building on this, the authors develop a multi-granularity, distribution-aware DSL and compiler that seamlessly combines thread-local control with collective operators to generate efficient code across GPUs and AI accelerators. The approach achieves near hand-tuned performance on modern devices and demonstrates clear advantages in multi-GPU and heterogeneous backends, with substantial reductions in development effort. Overall, Axe provides a practical foundation for unifying layout semantics across distributed and heterogeneous hardware, enabling productive and high-performance ML compilation.
Abstract
Scaling modern deep learning workloads demands coordinated placement of data and compute across device meshes, memory hierarchies, and heterogeneous accelerators. We present Axe Layout, a hardware-aware abstraction that maps logical tensor coordinates to a multi-axis physical space via named axes. Axe unifies tiling, sharding, replication, and offsets across inter-device distribution and on-device layouts, enabling collective primitives to be expressed consistently from device meshes to threads. Building on Axe, we design a multi-granularity, distribution-aware DSL and compiler that composes thread-local control with collective operators in a single kernel. Experiments show that our unified approach can bring performance close to hand-tuned kernels on across latest GPU devices and multi-device environments and accelerator backends.
