mlsanityData to 14 Oct 2026

Tensor Seeks Layout: Formalizing Layout Selection for ML Compilers

arXiv 2608.21555 ↗First posted 21 Aug 2026cs.PL cs.DS cs.LGcited by 0

Not on the map. Why?

Abstract (arXiv)

Modern machine learning compilers select tensor memory layouts to minimize execution cost under hardware constraints. Layout selection is global: an operator may be fastest under one layout while its consumers prefer another, and aligning these preferences requires explicit layout conversions that can hurt model performance. Despite its practical importance, layout selection lacks a formal basis, so current compilers rely on ad-hoc heuristics. This paper presents the first formal study of layout selection in machine learning compilers. We formulate the problem as combinatorial optimization over dataflow graphs, minimizing the sum of operator execution costs and the per-tensor cost of these conversions. Our theoretical analysis shows that optimal layout selection is computationally hard, even for programs containing only matrix multiplications over two-dimensional tensors. We design an optimal polynomial-time algorithm for dataflow graphs of bounded treewidth. For general instances, we give a weighted MaxSAT encoding that an off-the-shelf solver can optimize. The formulation unifies several existing layout optimization strategies, including XLA's layout assignment, partition dimension selection in systolic array compilers, and layout planning in mobile GPU optimizers. We implement the formalization in a production compiler for an AI accelerator and measure the execution time of the compiled models under greedy heuristics, the compiler's rule-based strategy, and an optimal solver. Simple heuristics degrade execution time by up to 5× on some workloads. Where the compiler's cost model is accurate, the solver matches or beats the rule-based strategy. On workloads with complex data movement it falls behind, and since the solver minimizes the stated objective exactly, that gap isolates cost-model error from search quality, showing where compiler effort actually pays off.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 21 of its 66 references that are in the map. First posted on arXiv 21 Aug 2026.

Builds on

21 of 66 references.

References · 21

  1. 2017Attention Is All You Needcited by 60,361
  2. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
  3. 2014cuDNN: Efficient Primitives for Deep Learningcited by 245
  4. 2018Learning to Optimize Tensor Programscited by 140
  5. 2020Data Movement Is All You Need: A Case Study on Optimizing Transformerscited by 108
  6. 2018Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractionscited by 85
  7. 2021DNNFusion: Accelerating Deep Neural Networks Execution with Advanced Operator Fusioncited by 57
  8. 2018Ithemal: Accurate, Portable and Fast Basic Block Throughput Estimation using Deep Neural Networkscited by 43
  9. 2024Mirage: A Multi-Level Superoptimizer for Tensor Programscited by 41
  10. 2018A Survey on Compiler Autotuning using Machine Learningcited by 40
  11. 2018Optimizing CNN Model Inference on CPUscited by 29
  12. 2023TpuGraphs: A Performance Prediction Dataset on Large Tensor Computational Graphscited by 16
9 more
  1. 2024SmartMem: Layout Transformation Elimination and Adaptation for Efficient DNN Execution on Mobilecited by 12
  2. 2023oneDNN Graph Compiler: A Hybrid Approach for High-Performance Deep Learning Compilationcited by 7
  3. 2025Hardware Acceleration for Neural Networks: A Comprehensive Surveycited by 6
  4. 2020FlexSA: Flexible Systolic Array Architecture for Efficient Pruned DNN Model Trainingcited by 5
  5. 2022ArrayFlex: A Systolic Array Architecture with Configurable Transparent Pipeliningcited by 3
  6. 2015Autotuning OpenCL Workgroup Size for Stencil Patternscited by 2
  7. 2018Improved Basic Block Reorderingcited by 2
  8. 2021Joint Program and Layout Transformations to enable Convolutional Operators on Specialized Hardware based on Constraint Programmingcited by 1
  9. 2025Modeling Layout Abstractions Using Integer Set Relationscited by 1

Built on by

Not cited yet.