raw torch ops
scores, mask, softmax, matmul — visible
wrap in a module
learnable Q/K/V/O projections
split into heads
reshape, don't duplicate compute
swap the kernel
F.scaled_dot_product_attention (FlashAttention)
First, the formula with nothing hidden — raw tensor ops, so every step from the math block in Layer 2 has a visible line of code.