Skip to content
HN On Hacker News ↗

CODA: Rewriting Transformer Blocks as GEMM-Epilogue Programs

▲ 105 points 12 comments by matt_d 2d ago HN discussion ↗

Pangram verdict · v3.3

We believe that this document is fully AI-generated

99 %

AI likelihood · overall

AI
0% human-written 100% AI-generated
SEGMENTS · HUMAN 0 of 1
SEGMENTS · AI 1 of 1
WORD COUNT 233
PEAK AI % 100% · §1
Analyzed
May 22
backend: pangram/v3.3
Segments scanned
1 windows
avg 233 words each
Distribution
0 / 100%
human / AI fraction
Verdict
AI
Pangram v3.3

Article text · 233 words · 1 segments analyzed

Human AI-generated
§1 AI · 100%

View PDF HTML (experimental) 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. 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. Subjects: Machine Learning (cs.LG) Cite as: arXiv:2605.19269 [cs.LG]   (or arXiv:2605.19269v2 [cs.LG] for this version)   https://doi.org/10.48550/arXiv.2605.19269 arXiv-issued DOI via DataCite Submission history From: Han Guo [view email] [v1] Tue, 19 May 2026 02:30:43 UTC (1,121 KB) [v2] Wed, 20 May 2026 17:38:24 UTC (493 KB)