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
- How to Optimize a CUDA Matmul Kernel for cuBLAS-like Performance: a Worklogsiboehm.com
- Inside NVIDIA GPUs: Anatomy of high performance matmul kernels - Aleksa Gordićaleksagordic.com
- Transformer Inference Arithmetic | kipply's blogkipp.ly
- We reverse-engineered Flash Attention 4modal.com
- GitHub - wafer-ai/gpu-perf-engineering-resources: A curated resource list for learning AI performance engineering, from GPU fundamentals to production inference.github.com
- Outperforming cuBLAS on H100: a Worklogcudaforfun.substack.com
- Factoring RSA-260cognition.com
- Reiner Pope – The math behind how LLMs are trained and serveddwarkesh.com
- Outperforming cuBLAS on H100: a Worklogcudaforfun.substack.com
- Worklog: Optimising GEMM on NVIDIA H100 for cuBLAS-like Performance (WIP) – Hamza's Bloghamzaelshafie.bearblog.dev
- GPUs Go Brrr · Hazy Researchhazyresearch.stanford.edu