Concepts

Community articles on the ideas behind deep learning systems: math, hardware, algorithms and trade-offs.

The book follows kael one layer at a time. This section steps back and explains the ideas those layers rely on. Articles here are not tied to the order of the book, and many of them apply to any framework.

This section is written by the community. If a topic is missing, request it or write it.

Wanted articles

These topics have no article yet. Each one is a good first contribution. Open an issue to claim one so two people do not write the same page.

TopicWhat the article should explain
The memory hierarchyRegisters, caches, DRAM and HBM, and why data movement dominates kernel time
Numerical stabilitylog-sum-exp, stable softmax, catastrophic cancellation, epsilon terms
InitializationWhy weight scale matters, Xavier and Kaiming initialization derived
Normalization layersBatch norm, layer norm and RMS norm, what each normalizes and why
Optimizers in depthMomentum, Adam and AdamW derived, and what weight decay really does
TokenizationCharacters, words, BPE and why tokenizers shape model behavior
Attention variantsMulti-query, grouped-query and sliding window attention, and their memory costs
QuantizationInt8 and int4 weights, scales and zero points, and the accuracy trade-off
Mixed precision trainingMaster weights, loss scaling and which ops must stay in float32
Distributed trainingData, tensor and pipeline parallelism, and the communication each one needs
Reading a paper into codeA method to turn equations in a paper into a tested implementation

Articles

  1. Glossary Definitions of the terms used across the kael.cpp book, each linked to the chapter that covers it.
  2. Floating point for deep learning How float32, float16 and bfloat16 store numbers, where rounding, overflow and summation order change results, and how kael guards against each.