QR Decomp at the Speed of Light
How I placed 5th in the GPU MODE qr_v2 competition with common sense engineering, linear algebra tricks, an agent swarm, and a dream. I recently placed 5th in GPU MODE's qr_v2 competition, where a bunch of kernel writers and I raced to make batched QR decomposition lightning fast on NVIDIA's B200. If you missed the recent Twitter drama, QR has been getting attention because it can show up inside various rivaling deep learning optimizer algorithms. The competition made one thing very clear: the default PyTorch path is really slow for this workload. My final submission reached a 1499µs geometric mean on the validation set of 12 sizes, roughly 280× faster than torch.geqrf. Along the way I learned the B200 architecture from the ground up and found a few almost-heretical math tricks that make Householder QR much faster than I initially assumed possible. If you have never heard of Householder QR decomposition, then you're like me two weeks ago. I will build up the algorithm from scratch, dra
QR Decomp at the Speed of Light I recently placed 5th in GPU MODE's qr_v2 competition , where a bunch of kernel writers and I raced to make batched QR decomposition lightning fast on NVIDIA's B200. If you missed the recent Twitter drama, QR has been getting attention because it can show up inside various rivaling deep learning optimizer algorithms. The competition made one thing very clear: the default PyTorch path is really slow for this workload. My final submission reached a 1499µs geometric mean on the validation set of 12 sizes, roughly 280× faster than torch.geqrf . Along the
saved by
related reading
- Auto-research with codex: How I achieved a 232x Faster Kernel over baseline with Codex in GPU Mode's qr_v2 problemsankalp.bearblog.dev
- Strangely, Matrix Multiplications on GPUs Run Faster When Given "Predictable" Data! [short]thonking.ai
- What happens when you run a CUDA kernelfergusfinn.com
- How to Optimize a CUDA Matmul Kernel for cuBLAS-like Performance: a Worklogsiboehm.com
- Making Deep Learning go Brrrr From First Principleshorace.io
- Inside NVIDIA GPUs: Anatomy of high performance matmul kernels - Aleksa Gordićaleksagordic.com
- GPUs Go Brrr · Hazy Researchhazyresearch.stanford.edu
- The Best GPUs for Deep Learning in 2023 — An In-depth Analysistimdettmers.com
- Outperforming cuBLAS on H100: a Worklogcudaforfun.substack.com
- Better MoE model inference with warp decode · Cursorcursor.com
- 1.5x faster MoE training with custom MXFP8 kernels · Cursorcursor.com
- ⭐️ Fast LLM Inference From Scratchandrewkchan.dev