{"slug": "tensor-seeks-layout-formalizing-layout-selection-for-ml-compilers", "title": "Tensor Seeks Layout: Formalizing Layout Selection for ML Compilers", "summary": "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.", "body_md": "# Computer Science > Programming Languages\n\n  [Submitted on 21 Aug 2026]\n\n# Title:Tensor Seeks Layout: Formalizing Layout Selection for ML Compilers\n\n[View PDF](https://arxiv.org/pdf/2608.21555)\n\n[HTML (experimental)](https://arxiv.org/html/2608.21555v1)\n\nAbstract: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.\n\nThis 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.\n\nThe 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.\n\n### Additional Features\n\n### Current browse context:\n\ncs.PL\n\n### References & Citations\n\nLoading...\n\n# Bibliographic and Citation Tools\n\nBibliographic Explorer \n\n*(*[What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))\nConnected Papers \n\n*(*[What is Connected Papers?](https://www.connectedpapers.com/about))\nLitmaps \n\n*(*[What is Litmaps?](https://www.litmaps.co/))\nscite Smart Citations \n\n*(*[What are Smart Citations?](https://www.scite.ai/))\n# Code, Data and Media Associated with this Article\n\nalphaXiv \n\n*(*[What is alphaXiv?](https://alphaxiv.org/))\nCatalyzeX Code Finder for Papers \n\n*(*[What is CatalyzeX?](https://www.catalyzex.com))\nDagsHub \n\n*(*[What is DagsHub?](https://dagshub.com/))\nGotit.pub \n\n*(*[What is GotitPub?](http://gotit.pub/faq))\nHugging Face \n\n*(*[What is Huggingface?](https://huggingface.co/huggingface))\nScienceCast \n\n*(*[What is ScienceCast?](https://sciencecast.org/welcome))\n# Demos\n\n# Recommenders and Search Tools\n\nInfluence Flower \n\n*(*[What are Influence Flowers?](https://influencemap.cmlab.dev/))\nCORE Recommender \n\n*(*[What is CORE?](https://core.ac.uk/services/recommender))\n# arXivLabs: experimental projects with community collaborators\n\narXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.\n\nBoth 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.\n\nHave an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).", "url": "https://wpnews.pro/news/tensor-seeks-layout-formalizing-layout-selection-for-ml-compilers", "canonical_source": "https://arxiv.org/abs/2608.21555", "published_at": "2026-11-14 19:48:33+00:00", "updated_at": "2026-11-14 19:53:17.514713+00:00", "lang": "en", "topics": ["machine-learning", "ai-research", "ai-infrastructure", "developer-tools"], "entities": ["arXiv", "XLA"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/tensor-seeks-layout-formalizing-layout-selection-for-ml-compilers", "markdown": "https://wpnews.pro/news/tensor-seeks-layout-formalizing-layout-selection-for-ml-compilers.md", "text": "https://wpnews.pro/news/tensor-seeks-layout-formalizing-layout-selection-for-ml-compilers.txt", "jsonld": "https://wpnews.pro/news/tensor-seeks-layout-formalizing-layout-selection-for-ml-compilers.jsonld"}}