Manning Early Access Program (MEAP)
Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
Until recently, writing GPU kernels for LLM training and inference meant learning low-level programming tools like CUDA and C++. Triton, an open source, Python-based DSL created by OpenAI, bridges the gap between high-level machine learning frameworks and low-level GPU programming. Triton is built into PyTorch 2 and backed by NVIDIA, Intel, AMD, and Red Hat.
In GPU Programming with Triton, you'll learn how to work within the Triton ecosystem, from writing your first kernel to implementing advanced LLM features like FlashAttention and Native Sparse Attention. You'll use Triton to deliver the kernel-level control, fusion power, and acceleration that frameworks like PyTorch need under the hood without dropping down to CUDA and C++.
In this practical book written for readers with no previous GPU programming experience, author Harshwardhan Fartale introduces Triton’s innovative block-level programming model that replaces the tedious manipulation of low-level threads required by CUDA. Written for the latest hardware and LLMs, this book teaches GPU programming and Triton together, in Python, by profiling real workloads, identifying bottlenecks, and understanding why each optimization (coalescing, tiling, shared memory, reductions, and fusion) actually works.
As you go, you'll build the kernels that power modern AI systems, including FlashAttention, Native Sparse Attention, sparse matrix multiplication, and on-chip fused operations. You'll learn to profile real workloads, find the bottlenecks, wrap your kernel for production, and integrate it end to end into PyTorch. Each chapter includes handpicked practice problems designed to build the fluency that makes working in Triton feel like second nature.
what's inside
Writing production-grade Triton kernels
Core optimization techniques
Building FlashAttention, Native Sparse Attention, and sparse matrix multiplication from scratch
Profiling real workloads and integrating custom Triton kernels into PyTorch
Reasoning about how GPUs actually execute your code
about the reader
For ML engineers and researchers comfortable with Python and PyTorch.
about the author
Harshwardhan Fartale is a researcher and engineer based in Bangalore, where he builds machine learning systems for scientific and defense applications. He has delivered courses in generative AI, machine learning, and MLOps to audiences ranging from university students to national research bodies.
Introductory offer Save 50% for a limited time!
eBook
pdf, ePub, online
$55.99
$27.99
you save $28.00 (50%)
Introductory offer Save 50% for a limited time!
print
includes eBook
$69.99
$34.99
you save $35.00 (50%)
with subscription
free or 50% off
$24.99
pro $24.99 per month
access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!