HackerPapers

arXiv:2505.23819cs.PL

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, Zahi Moudallal

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

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 $\mathbb{F}_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 linear layouts reduce engineering effort in the compiler backend while fixing several bugs in Triton's legacy layout system.

arXiv comments
Journal reference
DOI
Subjects
cs.PLProgramming Languages cs.ARHardware Architecture cs.DCDistributed, Parallel, and Cluster Computing cs.PFPerformance

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Jun 2025 to Jun 2025. Found in 1 HN submission from Jun 2025 to Jun 2025. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments1 thread

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.