Outlook#

The first run of the tnzr.agents workflow has six limitations, and we propose a next step for each. In related work on tensor programs, a language model writes or schedules each new kernel. In tnzr.agents, coding agents built a compiler once, and the compiler then compiles each new contraction without a language model.

Limitations and next steps#

Two limitations concern the workflow, three concern the compiler, and one concerns the compiler’s scope.

All results come from a single run of the workflow, with one choice of prompts, working times and budgets of reviews. A next run could tune these settings and apply the lessons of the first run.

The weekly limit of the agents’ subscription bounded their working time. When the agents reached the limit, their tasks waited for its reset. During the run, OpenAI reset the limit early four times, and we reset it once more. More capacity, from more subscriptions or from paying per token, would remove these waits. A tuned workflow, cheaper models for parts of the work and a lower reasoning effort for the frontier models would need fewer or cheaper tokens.

A backend can do the tiling inside large tile operations, which leaves its heuristic little to schedule. For example, the backend of the M4 GPU accepts only programs without loops, and it tiles each tile operation by fixed rules on the operation’s shapes and layouts. A next run could require backends with finer-grained tile operations, which would move the schedule into the TZIR programs. One option is a specification of TZIR that restricts the tile operations to tiles with two to four axes.

Each backend bounds the speed of its heuristic’s programs, because the optimization agents could not change their backends. For example, the backend of the GB10 GPU gives each cooperative thread array (CTA) at most 48 of the 99 KiB of shared memory that the device allows. This limit bounds the tiles that a program can keep in shared memory. On the M4 CPU, the backend calls LIBXSMM, whose kernels for 64-bit floating-point (FP64) tensors use only NEON vector instructions (Results). A next run could let the optimization agents revise their backends, which would lift limits such as the one on the GB10 GPU. Backends that write code in the instruction set directly, such as AArch64 assembly on the M4 CPU, would control every instruction of their kernels.

Agents of three backends reported two transforms that TZIR lacks. One splits a long reduction into partial sums, which run in parallel, and the other swaps the two inputs of a contraction. TZIR programs can hold both, but no transform creates them, so the heuristics missed such programs. For example, with bfloat16 (BF16) tensors, partial sums cut the time of one visible workload on the GB10 GPU from 9.8 to 2.5 ms. A next run could let the agents add such transforms to TZIR themselves.

The compiler compiles one contraction at a time, with 16-bit floating-point (FP16) and BF16 tensors on the GPUs and 32-bit floating-point (FP32) and FP64 tensors on the CPUs. We chose these datatypes to limit the work of toolkit and backend development. TZIR already expresses programs that chain contractions with reductions and elementwise operations. Heuristics and backends for such programs and for 8-bit floating point (FP8) and other quantized formats would extend the compiler to the building blocks of neural networks. The workflow can take on these extensions as new tasks, each with its own specifications and test cases.

References#

  1. [1]Paul Springer and Paolo Bientinesi. Design of a High-Performance GEMM-like Tensor–Tensor Multiplication. ACM Transactions on Mathematical Software 44(3):1–29, 2018. ↩
  2. [2]Devin A. Matthews. High-Performance Tensor Contraction without Transposition. SIAM Journal on Scientific Computing 40(1):C1–C24, 2018. ↩
  3. [3]Jonathan Ragan-Kelley, Connelly Barnes, Andrew Adams, Sylvain Paris, Frédo Durand and Saman Amarasinghe. Halide: A Language and Compiler for Optimizing Parallelism, Locality, and Recomputation in Image Processing Pipelines. ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), 519–530, 2013. ↩
  4. [4]Siyuan Feng, Bohan Hou, Hongyi Jin, Wuwei Lin, Junru Shao, Ruihang Lai, Zihao Ye, Lianmin Zheng, Cody Hao Yu, Yong Yu and Tianqi Chen. TensorIR: An Abstraction for Automatic Tensorized Program Optimization. ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), Volume 2, 804–817, 2023. ↩
  5. [5]Philippe Tillet, H. T. Kung and David Cox. Triton: An Intermediate Language and Compiler for Tiled Neural Network Computations. ACM SIGPLAN International Workshop on Machine Learning and Programming Languages (MAPL), 10–19, 2019. ↩
  6. [6]Martin Paul Lücke, Oleksandr Zinenko, William S. Moses, Michel Steuwer and Albert Cohen. The MLIR Transform Dialect: Your Compiler Is More Powerful Than You Think. ACM/IEEE International Symposium on Code Generation and Optimization (CGO), 241–254, 2025. ↩
  7. [7]Anne Ouyang, Simon Guo, Simran Arora, Alex L. Zhang, William Hu, Christopher Ré and Azalia Mirhoseini. KernelBench: Can LLMs Write Efficient GPU Kernels? International Conference on Machine Learning (ICML), PMLR 267:47356–47415, 2025. ↩
  8. [8]Jianghui Wang, Vinay Joshi, Saptarshi Majumder, Xu Chao, Bin Ding, Ziqiong Liu, Pratik Prabhanjan Brahma, Dong Li, Zicheng Liu and Emad Barsoum. GEAK: Introducing Triton Kernel AI Agent & Evaluation Benchmarks. arXiv:2507.23194, 2025. ↩
  9. [9]Genghan Zhang, Shaowei Zhu, Anjiang Wei, Zhenyu Song, Allen Nie, Zhen Jia, Nandita Vijaykumar, Yida Wang and Kunle Olukotun. AccelOpt: A Self-Improving LLM Agentic System for AI Accelerator Kernel Optimization. Proceedings of Machine Learning and Systems (MLSys) 8, 541–568, 2026. ↩
  10. [10]Chris Cummins, Volker Seeker, Dejan Grubisic, Mostafa Elhoushi, Youwei Liang, Baptiste Roziere, Jonas Gehring, Fabian Gloeckle, Kim Hazelwood, Gabriel Synnaeve and Hugh Leather. Large Language Models for Compiler Optimization. arXiv:2309.07062, 2023. ↩
  11. [11]Yi Zhai, Sijia Yang, Keyu Pan, Renwei Zhang, Shuo Liu, Chao Liu, Zichun Ye, Jianmin Ji, Jie Zhao, Yu Zhang and Yanyong Zhang. Enabling Tensor Language Model to Assist in Generating High-Performance Tensor Programs for Deep Learning. USENIX Symposium on Operating Systems Design and Implementation (OSDI), 289–305, 2024. ↩
  12. [12]Ming Zhong, Fang Lv, Lulin Wang, Lei Qiu, Yingying Wang, Ying Liu, Huimin Cui, Xiaobing Feng and Jingling Xue. VEGA: Automatically Generating Compiler Backends Using a Pre-Trained Transformer Model. ACM/IEEE International Symposium on Code Generation and Optimization (CGO), 90–106, 2025. ↩