Aniket Maheshwari·4d agoFlashAttention in Triton: Up to 1.7× Faster Than PyTorch's Attention on a Laptop GPU
Aniket Maheshwari·Nov 15Online softmax: how to compute softmax in piecesIn my last article, naive attention ran into a wall: the N×N score matrix has to go to memory and back, and at long context that traffic is…
Aniket Maheshwari·Oct 21Naive attention from scratch — the memory wall FlashAttention removesStandard attention has a memory problem, and the cleanest way to understand FlashAttention is to first build the version that has it.A response icon2A response icon2
Aniket Maheshwari·Sep 23Online softmax from scratch — the primitive behind FlashAttentionThis is the first post in a series building toward FlashAttention. It starts with softmax, because the core trick in FlashAttention is…
Aniket Maheshwari·Aug 27FP32 to FP16 tensor cores: why naive wmma beats FP32 optimizationIn my previous articles, I’ve tried optimizing a matrix multiplication kernel using different optimization techniques to get from 467 to…
Aniket Maheshwari·Aug 19Using float4 to fix uncoalesced writes in a CUDA matmulIn my last matmul article, I ended with a bottleneck the profiler had flagged: the write-back to global memory was uncoalesced, wasting 75%…
Aniket Maheshwari·Aug 4From naive atomics to warp shuffles: building a CUDA reduction kernel on an RTX 3050Reduction sounds simple. Summing 16 million numbers is a one-liner in Python. On a GPU it’s a whole different process. There are three ways…
Aniket Maheshwari·Jul 28From 467 to 3600 GFLOP/s: optimizing CUDA matrix multiplication on an RTX 3050Three versions of the same problem — matrix multiplication. Same GPU, same matrix size, same math. Here’s what each one measured: