Skip to content
Tech News
← Back to articles

Modern GPU Programming for MLSys

read original more articles
Why This Matters

This article highlights the importance of advanced GPU programming techniques for optimizing machine learning workloads, emphasizing the need for a deep understanding of modern GPU architectures to build high-performance kernels. As AI models grow more complex and demanding, mastering these skills is crucial for both researchers and industry practitioners to improve training and inference efficiency. The focus on practical, hardware-aware programming approaches ensures that future GPU developments can be effectively harnessed for cutting-edge AI applications.

Key Takeaways

Modern GPU Programming For MLSys#

Machine learning systems sit at the heart of modern AI workloads. In these systems, performance often comes down to the quality of a small number of GPU kernels. Attention kernels, LLM prefill and decode kernels, low-precision block-scaled GEMMs, fused MoE layers, and other large fused kernels all directly shape end-to-end speed in both training and serving.

To make these kernels fast, however, we need more than a list of optimization tricks. Modern GPUs are no longer simple variations of the same old design. Recent architectures introduce richer memory spaces, new access patterns, and increasingly specialized execution units. To program them well, we need both a clear mental model of the hardware and a practical understanding of how high-performance kernels are built. This book is about developing both.

The book follows a simple progression: first understand the GPU hardware, then learn the programming model we will use, and finally build state-of-the-art kernels step by step. Our main target is the Blackwell generation, and our main running examples are fast matrix multiplication (GEMM) and FlashAttention. Along the way, we will also study the core ingredients behind GPU optimization: data layout, asynchronous data movement, and asynchronous coordination.

The material grows out of the Machine Learning Systems course series at Carnegie Mellon University. To make the ideas easier to study and easier to run, this book uses the TIRx Python DSL to build real GPU kernel examples step by step. TIRx stays close to the hardware, which lets us reason about low-level control while still learning through runnable code.