On the GPU Memory Hierarchy
Many programmers are familiar with how the CPU works – or at least in enough details to do their job. This post will build from this understanding to explain some of the important pillars of GPU programming, including roofline charts, threads, memory loads, and the memory hierarchy itself. A single CPU core executes instructions sequentially. Computers with a single CPU core can appear to be doing multiple things at the same time, but they’re actually quickly switching between tasks. Because a core can execute only one thread of execution at a time, they’re designed to be fast. In comparison, GPUs are focused on large workloads that can take more time to complete. The speed of GPUs depends on two primary factors: When writing a GPU program, it can be helpful to take these two parameters into account to get the theoretical upper bound of the algorithm we’re writing. We can do this on a roofline chart, which looks like this: In this graph, the highest FLOPs a specific algorithm can get i
On the GPU Memory Hierarchy On the GPU Memory Hierarchy 2023-12-29 Home Projects Blog Introduction High Level Considerations Details of GPU Programming Divergence Memory Loads Multiprocessors Memory Hierarchy The Great Memory Stagnation Memory is the treasury and guardian of all things. — Cicero Introduction Many programmers are familiar with how the CPU works – or at least in enough details to do their job. This post will build from this understanding to explain some of the important pillars of GPU programming, including roofline charts, threads, memory loads, and the memory hierarchy itself.
Explore this link on the map →saved by
related reading
- Making Deep Learning go Brrrr From First Principleshorace.io
- All About Rooflines | How To Scale Your Modeljax-ml.github.io
- GPU Performance Background User's Guide - NVIDIA Docsdocs.nvidia.com
- Inside NVIDIA GPUs: Anatomy of high performance matmul kernels - Aleksa Gordićaleksagordic.com
- How to Think About GPUs | How To Scale Your Modeljax-ml.github.io
- How to Optimize a CUDA Matmul Kernel for cuBLAS-like Performance: a Worklogsiboehm.com
- BrrrVizbrrrviz.com
- The Best GPUs for Deep Learning in 2023 — An In-depth Analysistimdettmers.com
- CUDA C++ Programming Guide (Legacy) — CUDA C++ Programming Guidedocs.nvidia.com
- Worklog: Optimising GEMM on NVIDIA H100 for cuBLAS-like Performance (WIP) – Hamza's Bloghamzaelshafie.bearblog.dev
- Transformer Inference Arithmetic | kipply's blogkipp.ly
- How To Scale Your Modeljax-ml.github.io