NeurIPS 2026QuestionsPapersAreasAboutMarkdown

CODA: Rewriting Transformer Blocks as GEMM-Epilogue Programs

Han Guo, Jack Zhang, Arjun Menon, Driss Guessous, Vijay Thakkar, Yoon Kim, Tri Dao

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: Efficient LLM Inference & Training › Efficient LLM Inference · Type: new method · Keywords: Transformer training, GPU kernel abstraction, GEMM-plus-epilogue, memory-bound operators, performance optimization

Areas: LLM Reasoning › Efficient Reasoning › Efficient Transformers; Model Architectures & Sequence Modeling › Language Model Architectures › Efficient Attention

Summary

CODA introduces a GPU kernel abstraction that rewrites Transformer block computations as GEMM-plus-epilogue programs to reduce memory-bound overhead and improve training efficiency.

Explained to a 5-year-old

Big computer programs called transformers learn by moving lots of information around. Besides the main math, they also do many small steps like scaling numbers and adding results. Those small steps often move huge amounts of information back and forth between memory and the processor, which makes training slow. The paper finds a trick to do those steps while the main math is still working on a piece of data that stays on the chip, so less moving is needed. This makes the big computers run faster and use less energy. The trick works whether the steps are written by people or by other computers.

Explained to a 5-year-old, longer

When we teach big computer programs how to understand and write text, we call them transformers. These programs do a lot of math, but besides the main math they also do many small steps like scaling numbers and adding results. Those small steps often move huge amounts of information back and forth between memory and the processor, which makes training slow. The paper notices that many of these steps can be rewritten so they happen while the main math is still working on a piece of data that stays on the chip. By doing this, the extra steps use less memory traffic and let the processor work faster. The new method uses a fixed main math routine and a few simple building blocks for the extra steps, making it easy to write and understand. This approach covers almost all of the non-attention parts of the forward and backward passes of a transformer block. Experiments show that both human-written and AI-written versions of this method run quickly on typical workloads. The result is a way to train large language models more efficiently while keeping the code simple and productive.

For a technical reader

The paper identifies that many non-attention operations in transformer training are memory-bound, causing performance bottlenecks. It proposes a kernel abstraction that re-expresses these operations as a GEMM followed by a small set of epilogue primitives, allowing them to execute while the GEMM output tile resides on-chip. This design keeps the high-performance GEMM loop unchanged while providing a constrained, composable interface for scaling, reductions, and accumulations. The abstraction is expressive enough to cover nearly all non-attention computations in both forward and backward passes, and it works for kernels written by humans or generated by LLMs. Evaluations on representative transformer workloads demonstrate high performance, showing that the GEMM-plus-epilogue paradigm can combine framework-level productivity with hardware-level efficiency.

Problem

Transformer training spends a significant amount of time in memory-bound operators such as normalization, activation, residual updates, and reductions, which move large tensors through global memory with little arithmetic, creating a bottleneck. This data movement limits performance even in highly optimized training stacks.

Method

The approach reparameterizes many Transformer operators so that they execute while a GEMM output tile remains on chip, using a fixed GEMM mainloop and a small set of composable epilogue primitives for scaling, reductions, pairwise transformations, and accumulation. This constrained interface allows covering nearly all non-attention computation in forward and backward passes.

Results

The approach achieves high performance across representative Transformer workloads, indicating that the GEMM-plus-epilogue programming paradigm can combine framework-level productivity with hardware-level efficiency.

Contributions

It introduces a GPU kernel abstraction that expresses non-attention Transformer computations as GEMM-plus-epilogue programs, enabling on-chip execution of many operators and covering nearly all such computations in forward and backward passes. It also demonstrates that both human- and LLM-authored kernels can be expressed within this constrained interface, achieving high performance on representative workloads.

Practical relevance

It provides a practical path to improve training efficiency and productivity for Transformer models on GPUs.

Research questions this paper is counted under

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction