cd /news/machine-learning/tensor-seeks-layout-formalizing-layo… · home › topics › machine-learning › article
[ARTICLE · art-169702] src=arxiv.org ↗ pub= topic=machine-learning verified=true sentiment=· neutral

Tensor Seeks Layout: Formalizing Layout Selection for ML Compilers

A paper submitted to arXiv on 21 Aug 2026 presents the first formal study of tensor layout selection in machine learning compilers, formulating it as combinatorial optimization over dataflow graphs that minimizes operator execution costs plus per-tensor layout conversion costs. The authors prove optimal layout selection is computationally hard even for programs containing only matrix multiplications over two-dimensional tensors, give an optimal polynomial-time algorithm for dataflow graphs of bounded treewidth, and provide a weighted MaxSAT encoding for general instances. Implemented in a production compiler for an AI accelerator, the formalization showed simple heuristics degrade execution time by up to 5x on some workloads, while the optimal solver matched or beat the compiler's rule-based strategy where the cost model is accurate and fell behind on workloads with complex data movement.

read2 min views1 publishedNov 14, 2026
Tensor Seeks Layout: Formalizing Layout Selection for ML Compilers
Image: source
  [Submitted on 21 Aug 2026]


[View PDF](https://arxiv.org/pdf/2608.21555)

[HTML (experimental)](https://arxiv.org/html/2608.21555v1)

Abstract: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\times$ 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.

Additional Features

Current browse context:

cs.PL

References & Citations

...

Bibliographic Explorer

(What is the Explorer?) Connected Papers

(What is Connected Papers?) Litmaps

(What is Litmaps?) scite Smart Citations

(What are Smart Citations?) alphaXiv

(What is alphaXiv?) CatalyzeX Code Finder for Papers

(What is CatalyzeX?) DagsHub

(What is DagsHub?) Gotit.pub

(What is GotitPub?) Hugging Face

(What is Huggingface?) ScienceCast

(What is ScienceCast?) Influence Flower

(What are Influence Flowers?) CORE Recommender

(What is CORE?) arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

── more in #machine-learning 4 stories · sorted by recency
── more on @arxiv 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/tensor-seeks-layout-…] indexed:0 read:2min 2026-11-14 · —