CODA: Rewriting Transformer Blocks as GEMM-Epilogue Programs

Han Guo, Jack Zhang, Arjun Menon, Driss Guessous, Vijay Thakkar +2 more
5/19/2026
cs.LG
transformer-attention

No confident code implementation found for this paper.

Abstract

Transformer training systems are built around dense linear algebra, yet a nontrivial fraction of end-to-end time is spent on surrounding memory-bound operators. Normalization, activations, residual updates, reductions, and related computations repeatedly move large intermediate tensors through global memory while performing little arithmetic, making data movement an increasingly important bottleneck in otherwise highly optimized training stacks.

Show full abstract

We introduce CODA, a GPU kernel abstraction that expresses these computations as GEMM-plus-epilogue programs. CODA is based on the observation that many Transformer operators exposed as separate framework kernels can be algebraically reparameterized to execute while a GEMM output tile remains on chip, before it is written to memory. The abstraction fixes the GEMM mainloop and exposes a small set of composable epilogue primitives for scaling, reductions, pairwise transformations, and accumulation. This constrained interface preserves the performance structure of expert-written GEMMs while remaining expressive enough to cover nearly all non-attention computation in the forward and backward pass of a standard Transformer block. Across representative Transformer workloads, both human- and LLM-authored CODA kernels achieve high performance, suggesting that GEMM-plus-epilogue programming offers a practical path toward combining framework-level productivity with hardware-level efficiency.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{guo2026coda,
  title  = {CODA: Rewriting Transformer Blocks as GEMM-Epilogue Programs},
  author = {Han Guo and Jack Zhang and Arjun Menon and Driss Guessous and Vijay Thakkar and Yoon Kim and Tri Dao},
  year   = {2026},
  eprint = {2605.19269},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.19269v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.19269.svg)](https://codeofpaper.com/paper/2605.19269)

Discussion