cfregly/ai-performance-engineering
Code, labs, and resources for O'Reilly AI Systems Performance Engineering: GPU optimization, distributed training, inference scaling, and full-stack tuning.
What it solves
This project provides the code, tooling, and resources needed to optimize the performance of modern AI workloads. It addresses the challenge of moving beyond raw hardware power to achieve "goodput" by tuning the entire stack—including GPUs, interconnects, runtime stacks, and algorithms—to reduce cost per token and increase throughput for training and inference.
How it works
It employs an empirical, profile-first methodology using tools like Nsight Systems, Nsight Compute, and the PyTorch profiler to identify bottlenecks. The project covers several optimization layers:
- Hardware & Kernel Level: Using CUDA C++ and OpenAI Triton to write high-impact kernels and optimize memory access patterns.
- Framework Level: Leveraging the PyTorch compiler stack (
torch.compile) and distributed strategies (FSDP, TP, PP, CP) to scale training. - Serving Level: Implementing high-throughput inference using vLLM, SGLang, and TensorRT-LLM, with techniques like disaggregated prefill/decode and paged KV caches.
- System Level: Tuning OS configurations, Docker/Kubernetes orchestration, and networking (NCCL) to minimize communication bubbles.
Who it’s for
This is designed for AI/ML engineers, systems engineers, researchers, and platform teams who are building or operating large-scale training and inference pipelines.
Highlights
- Comprehensive Checklist: A 200+ item performance checklist covering the full lifecycle from hardware planning to power management.
- Full-Stack Coverage: Guidance ranging from low-level CUDA/Triton kernels to high-level Kubernetes orchestration.
- Advanced Inference Techniques: Focus on disaggregated prefill/decode architectures and KV cache tuning for trillion-parameter models.
- Practical Tooling: Integration with industry-standard profilers and compiler stacks for empirical tuning.
関連
- プロジェクト
- プロジェクト
- プロジェクト
- プロジェクト
- プロジェクト