Code, labs, and resources for O'Reilly AI Systems Performance Engineering: GPU optimization, distributed training, inference scaling, and full-stack tuning.
Python
1,992
3,139 commits
updated Sep 17, 2026
Update: Are you interested in a hands-on course for this material?
If so, fill out this form to express interest and be notified.
AI Systems Performance Engineering code, tooling, and resources for the O'Reilly book covering GPU optimization, distributed training, inference scaling, and full-stack performance tuning for modern AI workloads.
Chat with this book directly!
Just take me to the code.
O'Reilly Book – November 2025
Available on Amazon
Modern AI systems demand more than raw FLOPs—they need goodput‑driven, profile‑first engineering across hardware, software, and algorithms. This hands‑on guide shows how to turn GPUs, interconnects, and runtime stacks into efficient, reliable training and inference pipelines.
You’ll learn to diagnose real bottlenecks with Nsight and PyTorch profilers, squeeze bandwidth and memory, and use compiler stacks (PyTorch + OpenAI Triton) to craft high‑impact kernels. On the serving side, master high‑throughput inference with vLLM/SGLang, TensorRT‑LLM, and NVIDIA Dynamo—including disaggregated prefill/decode and paged KV cache—then scale across racks without blowing the budget.
Using a hands‑on, empirical methodology with case studies, profiling data, this book is useful for AI/ML engineers, systems engineers, researchers, and platform teams building or operating training/inference at scale. The book contains thousands of lines of PyTorch and CUDA C++ code examples for modern NVIDIA GPUs.
Profile for goodput, not just utilization—use Nsight Systems/Compute and the PyTorch profiler to find the real stall points.
Exploit memory & bandwidth—optimize layouts, caching, and data movement to feed the GPU continuously.
Tune with compilers—leverage the PyTorch compiler stack and Triton to generate high‑impact kernels without C++ boilerplate.
Scale training sanely—apply parallelism strategies (DP, FSDP, TP, PP, CP, and MoE) and overlap computation/communication to minimize bubbles.
Serve trillion parameter models efficiently—use vLLM, SGLang, TensorRT‑LLM and NVIDIA Dynamo with disaggregated prefill/decode and KV‑cache movement.
Reduce cost per token—engineer for performance‑per‑watt and throughput per dollar, not just peak speed.
Adopt AI‑assisted optimization—let AI help synthesize and tune kernels as systems outgrow manual tweaking
Ship with confidence—apply the 200+ item checklist to reproduce wins and prevent regressions across teams.
Chris Fregly is a performance engineer and AI product leader who has driven innovations at Netflix, Databricks, and Amazon Web Services (AWS). He has led performance‑focused engineering teams that built AI/ML products, scaled go‑to‑market initiatives, and reduced cost for large‑scale generative‑AI and analytics workloads.
Chris is the author of two other O’Reilly books: Data Science on AWS and Generative AI on AWS. He's also the creator of the O’Reilly course “High‑Performance AI in Production with NVIDIA GPUs" and the DeepLearning.ai course "Generative AI with Large-Language Models" with Andrew Ng.
His work spans kernel‑level tuning, compiler‑driven acceleration, distributed training, and high‑throughput inference. Chris hosts a monthly meetup called AI Performance Engineering.
The book ships with a 200+ item performance checklist that captures field‑tested optimizations covering the entire lifecycle. You can apply these immediately:
Built in San Francisco for the AI performance engineering community
Monthly meetups with 100k+ members across 20+ cities:
Recent sessions:
Contributions are welcome! See CONTRIBUTING.md for guidelines on code, documentation, and performance improvements.
Apache 2.0 License – see LICENSE for details.
Python
82.7%
Cuda
12.2%
Shell
3.5%
TypeScript
1.1%
Code, labs, and resources for O'Reilly AI Systems Performance Engineering: GPU optimization, distributed training, inference scaling, and full-stack tuning.
Python
1,992
3,139 commits
updated Sep 17, 2026
Update: Are you interested in a hands-on course for this material?
If so, fill out this form to express interest and be notified.
AI Systems Performance Engineering code, tooling, and resources for the O'Reilly book covering GPU optimization, distributed training, inference scaling, and full-stack performance tuning for modern AI workloads.
Chat with this book directly!
Just take me to the code.
O'Reilly Book – November 2025
Available on Amazon
Modern AI systems demand more than raw FLOPs—they need goodput‑driven, profile‑first engineering across hardware, software, and algorithms. This hands‑on guide shows how to turn GPUs, interconnects, and runtime stacks into efficient, reliable training and inference pipelines.
You’ll learn to diagnose real bottlenecks with Nsight and PyTorch profilers, squeeze bandwidth and memory, and use compiler stacks (PyTorch + OpenAI Triton) to craft high‑impact kernels. On the serving side, master high‑throughput inference with vLLM/SGLang, TensorRT‑LLM, and NVIDIA Dynamo—including disaggregated prefill/decode and paged KV cache—then scale across racks without blowing the budget.
Using a hands‑on, empirical methodology with case studies, profiling data, this book is useful for AI/ML engineers, systems engineers, researchers, and platform teams building or operating training/inference at scale. The book contains thousands of lines of PyTorch and CUDA C++ code examples for modern NVIDIA GPUs.
Profile for goodput, not just utilization—use Nsight Systems/Compute and the PyTorch profiler to find the real stall points.
Exploit memory & bandwidth—optimize layouts, caching, and data movement to feed the GPU continuously.
Tune with compilers—leverage the PyTorch compiler stack and Triton to generate high‑impact kernels without C++ boilerplate.
Scale training sanely—apply parallelism strategies (DP, FSDP, TP, PP, CP, and MoE) and overlap computation/communication to minimize bubbles.
Serve trillion parameter models efficiently—use vLLM, SGLang, TensorRT‑LLM and NVIDIA Dynamo with disaggregated prefill/decode and KV‑cache movement.
Reduce cost per token—engineer for performance‑per‑watt and throughput per dollar, not just peak speed.
Adopt AI‑assisted optimization—let AI help synthesize and tune kernels as systems outgrow manual tweaking
Ship with confidence—apply the 200+ item checklist to reproduce wins and prevent regressions across teams.
Chris Fregly is a performance engineer and AI product leader who has driven innovations at Netflix, Databricks, and Amazon Web Services (AWS). He has led performance‑focused engineering teams that built AI/ML products, scaled go‑to‑market initiatives, and reduced cost for large‑scale generative‑AI and analytics workloads.
Chris is the author of two other O’Reilly books: Data Science on AWS and Generative AI on AWS. He's also the creator of the O’Reilly course “High‑Performance AI in Production with NVIDIA GPUs" and the DeepLearning.ai course "Generative AI with Large-Language Models" with Andrew Ng.
His work spans kernel‑level tuning, compiler‑driven acceleration, distributed training, and high‑throughput inference. Chris hosts a monthly meetup called AI Performance Engineering.
The book ships with a 200+ item performance checklist that captures field‑tested optimizations covering the entire lifecycle. You can apply these immediately:
Built in San Francisco for the AI performance engineering community
Monthly meetups with 100k+ members across 20+ cities:
Recent sessions:
Contributions are welcome! See CONTRIBUTING.md for guidelines on code, documentation, and performance improvements.
Apache 2.0 License – see LICENSE for details.
Python
82.7%
Cuda
12.2%
Shell
3.5%
TypeScript
1.1%