In our project tnzr.agents, coding agents build a compiler for tensor contractions. Our workflow splits the development into tasks, and each task gives one agent a fixed working time for one part of the compiler. A review system judges the agent’s work with hidden test cases. We ran the workflow once for three GPUs and two CPUs from NVIDIA, AMD and Apple, and the agents completed 11 tasks with 295 hours of working time and 109 reviews. The resulting compiler runs without a language model and uses heuristics to compile a new contraction within seconds.

The figure below shows the speedups of the compiler’s programs over the fastest of three baselines with BF16 on the GPUs and FP32 on the CPUs. The geometric means per benchmark set and device range from 1.04× to 5.00× on general contractions from TCCG and NWChem and from 0.60× to 1.36× on GEMMs from DeepGEMM, Muse and oneDNN. The project website describes the workflow, the compiler and its results in detail.

Speedup of the compiler's programs over the fastest of three baselines on five benchmark sets, with one panel per device. On every device, the bars of TCCG and NWChem rise above the line at 1.