Outperforming cuBLAS on H100: a Worklog
In this post, we’ll iteratively implement a CUDA kernel for matrix multiplication on latest generation1 NVIDIA hardware: H100. We’ll gain a deep understanding of H100 architecture and showcase these optimizations step by step. The final kernel outperforms cuBLAS by 7% for N=4096. It fits in a single C++ file without any dependencies. This post is intended as a sequel to Simon’s legendary blog which showcases similar optimizations for A6000 GPU. However H100 GPUs are completely different beasts, requiring entirely different algorithms. As an example, algorithm from Simon’s blog is only able to achieve 4% of cuBLAS performance2. In this post, we will pick up from Simon’s blog and iteratively reach 107% of cuBLAS. All my code is available on Github. Thanks for reading Pranjal’s Substack! Subscribe for free to receive new posts and support my work. Our aim is not to be a cuBLAS replacement, but to design a slightly faster, yet simplistic, matmul kernel which works for generally large matri
Outperforming cuBLAS on H100: a Worklog CUDA matmul kernel - from scratch Pranjal Shankhdhar Nov 29, 2024 131 6 9 Share In this post, we’ll iteratively implement a CUDA kernel for matrix multiplication on latest generation 1 NVIDIA hardware: H100. We’ll gain a deep understanding of H100 architecture and showcase these optimizations step by step. The final kernel outperforms cuBLAS by 7% for N=4096 . It fits in a single C++ file without any dependencies. This post is intended as a sequel to Simon’s legendary blog which showcases similar optimizations for A6000 GPU. However H100 GPUs are complet
Explore this link on the map →saved by
related reading
- Reverse-Engineering cuBLASaccu.org
- How to Optimize a CUDA Matmul Kernel for cuBLAS-like Performance: a Worklogsiboehm.com
- Outperforming cuBLAS on H100: a Worklogcudaforfun.substack.com
- CUTLASS: Fast Linear Algebra in CUDA C++ | NVIDIA Technical Blogdeveloper.nvidia.com
- GitHub - wangzyon/NVIDIA_SGEMM_PRACTICE: Step-by-step optimization of CUDA SGEMM · GitHubgithub.com
- Inside NVIDIA GPUs: Anatomy of high performance matmul kernels - Aleksa Gordićaleksagordic.com
- Worklog: Optimising GEMM on NVIDIA H100 for cuBLAS-like Performance (WIP) – Hamza's Bloghamzaelshafie.bearblog.dev
- GPU Performance Background User's Guide - NVIDIA Docsdocs.nvidia.com
- Mini Project: GPU Accelerated Matrix Multiplication (almost) like cuBLAS0mean1sigma.com
- CUDA C++ Programming Guide (Legacy) — CUDA C++ Programming Guidedocs.nvidia.com
- Implementing a fast Tensor Core matmul on the Ada Architecture | spatters.caspatters.ca
- GPUs Go Brrr · Hazy Researchhazyresearch.stanford.edu