Linear Layouts: Robust Code Generation of Efficient Tensor Computation Using $\mathbb{F}_2$
Keren Zhou, Mario Lezcano, Adam Goucher, Akhmed Rakhmati, Jeff Niu, Justin Lebar, Pawel Szczerbuk, Peter Bell, Phil Tillet, Thomas Raoux, and Zahi Moudallal

TL;DR
This paper introduces Linear Layouts, a systematic method using linear algebra over $_2$ to model tensor layouts, improving flexibility, efficiency, and robustness in tensor computation for deep learning.
Contribution
It presents a novel linear algebra-based framework for tensor layouts that simplifies design, enables generic conversions, and enhances integration with Triton.
Findings
Linear layouts enable flexible tensor layout definitions.
They improve kernel optimization in Triton.
They reduce engineering effort and fix bugs in Triton's layout system.
Abstract
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 . 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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTensor decomposition and applications · Computational Physics and Python Applications · Parallel Computing and Optimization Techniques
