Linear Layouts: Robust Code Generation of Efficient Tensor Computation Using đť”˝_2
Efficient tensor computation is a cornerstone of modern deep learning (DL) workloads, yet existing approaches struggle to achieve flexible and performant design and implementation of tensor layouts—mappings between logical tensors and hardware resources. The increasing complexity of DL algorithms and hardware demands a generic and systematic approach to handling tensor layouts. In this work, we introduce Linear Layouts, a novel approach that models tensor layouts using linear algebra over 𝔽 2 . By representing tensor layouts as binary matrices acting on the bits of the hardware representation, our approach enables a generic layout definition—as opposed to the classical case-by-case approach—and allows for generic layout-to-layout conversions, eliminating the quadratic explosion that plagues existing solutions. We integrate linear layouts with Triton and demonstrate their effectiveness in optimizing individual Triton operators as well as kernels written in Triton. We also show that li
Linear Layouts: Robust Code Generation of Efficient Tensor Computation Using 𝔽2\mathbb{F}_{2} Conference: Proceedings of the 31st ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 1; March 22–26, 2026; Pittsburgh, PA, USAProceedings of the 31st ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 1 (ASPLOS ’26), March 22–26, 2026, Pittsburgh, PA, USADOI: 10.1145/3760250.3762221ISBN: 979-8-4007-2165-6/26/03 Keren Zhou Note: The authors contributed equally to this research.…
saved by
related reading
- Mirage Persistent Kernel: A Compiler and Runtime for Mega-Kernelizing Tensor Programsarxiv.org
- How to Optimize a CUDA Matmul Kernel for cuBLAS-like Performance: a Worklogsiboehm.com
- Triton: An Intermediate Language and Compiler for Tiled Neural Network Computationseecs.harvard.edu
- [2410.20399] ThunderKittens: Simple, Fast, and Adorable AI Kernelsarxiv.org
- A friendly introduction to machine learning compilers and optimizershuyenchip.com
- Inside NVIDIA GPUs: Anatomy of high performance matmul kernels - Aleksa Gordićaleksagordic.com
- Tiny TPUtinytpu.com
- Transformers Inference Optimization Toolset | AstraBlogastralord.github.io
- twill.pdfcompilers.stanford.edu
- Tensor-Transformer Variants are Surprisingly Performant — LessWronglesswrong.com
- Implementing a fast Tensor Core matmul on the Ada Architecture | spatters.caspatters.ca
- [2604.07242] Weaves, Wires, and Morphisms: Formalizing and Implementing the Algebra of Deep Learningarxiv.org