CODA: Rewriting Transformer Blocks as GEMM-Epilogue Programs
Mirrored from r/LocalLLaMA for archival readability. Support the source by reading on the original site.
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.
[link] [comments]
More from r/LocalLLaMA
-
I fine-tuned Cohere Transcribe to support diarization and timestamps
May 22
-
Scrambling to max StrixHalo (+NVLink dual eGPU 3090 mod)
May 22
-
Can't believe I got it working! Dual GPU - 48gb VRAM llama-cpp server - R7900 + 7800XT
May 22
-
Vector Policy Optimization: Training for Diversity Improves Test-Time Search
May 22
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.