Ian Barber, an engineer who writes about ML compilers, argues that the proven difficulty of layout selection is not what slows real kernels down. His post on 24 November starts from an Amazon paper, Tensor Seeks Layout, which shows the problem is NP-hard for Trainium workloads. On ResNet-50, the authors’ exact solver found an optimum their cost model scored at 63.9 million cycles, while the simple heuristic scored 20.9 million. They blame the cost model.

Barber checked the same weakness in Triton, where a pass called RemoveLayoutConversions prices conversions at either zero or 32 times the bytes. Measured against an elementwise add, he found that rule overestimates cost by about 4x for fp32 and 19x for fp16. Swapping in a proper model changed little: of the kernels he tested, 8 got slower, 4 got faster, and 9 did not change.

His explanation is that kernels rarely face a real choice, and that ptxas, the closed-source compiler downstream, swings results more than the layout pass does.

Anyone tuning Triton kernels should look at register allocation in ptxas before rewriting layout heuristics.

Ian Barber’s blog, 24 November 2026.