It's my favorite kind of work: linear algebra insight + fast kernels.
When playing w Muon a while ago, we were thinking why not speed it up by operating on the small square matrix X X^T instead of the large rectangular matrix X. Jack, Noah, and Berlin spent many months understanding eigenvalues/vectors of the intermediate matrices in Muon, and finally came up with a simple and elegant algo to make this work.
View original post on X: Tri Dao
Published
Tri Dao's team speeds up Muon with Gram Newton-Schulz, up to 2x faster
AITri Dao says he and collaborators Jack, Noah, and Berlin reworked Muon to run Newton-Schulz on the small square matrix XX^T instead of the large rectangular matrix X. Per a quoted post from @jcz42, the Gram Newton-Schulz algorithm is mathematically equivalent and runs up to 2x faster, halving the FLOPs of each GEMM and validation perplexity is preserved within 0.01.
@tri_dao
We made Muon run up to 2x faster for free! Introducing Gram Newton-Schulz: a mathematically equivalent but computationally faster Newton-Schulz algorithm for polar decomposition. Gram Newton-Schulz rewrites Newton-Schulz such that instead of iterating on the expensive rectangular X matrix, we iterate on the small, square, symmetric XX^T Gram matrix to reduce FLOPs. This allows us to make more use of fast symmetric GEMM kernels on Hopper and Blackwell, halving the FLOPs of each of those GEMMs. Gram Newton-Schulz is a drop-in replacement of Newton-Schulz for your Muon use case: we see validation perplexity preserved within 0.01, and share our (long!) journey stabilizing this algorithm and ensuring that training quality is preserved above all else. This was a super fun project with @noahamsel, @berlinchen, and @tri_dao that spanned theory, numerical analysis, and ML systems! Blog and codebase linked below 🧵
Source details
Tri Dao · x.comPublished · added here
Original title: It's my favorite kind of work: linear algebra insight + fast kernels.
