Warp and Block Reductions
Build fundamental warp-level and block-level sum/max reduction primitives used by later kernels.
Implement reductions, activations, fused RMSNorm, Softmax, RoPE, and SwiGLU kernels for efficient inference.
Every source step is its own lesson with intuition, concepts, correctly rendered MathJax mathematics, implementation, tests, mistakes, and a checkpoint.
Build fundamental warp-level and block-level sum/max reduction primitives used by later kernels.
Implement residual addition and common transformer activations: GELU, SiLU, and SwiGLU.
Write RMSNorm, LayerNorm, and a fused residual-plus-RMSNorm kernel for pre-norm blocks.
Implement row-wise and causal softmax for attention score normalization.
Build token embedding lookup and rotary positional embedding (RoPE) kernels.
Implement dense linear layers, fused linear+bias+GELU, and a full SwiGLU MLP forward.
Compose RMSNorm-residual blocks and an end-to-end transformer FFN path for fused inference.