AI Infra
Explore 16 AI Infra papers by topic, read original sources, and practice available implementations in Python on PaperLeet.
Study large-model training and deployment through parallelism and state sharding, attention and KV memory, inference scheduling, and quantization.
Reading list · 16 papers
Training parallelism and state sharding
- GPipe
GPipe: Efficient Training of Giant Neural Networks using Pipeline Parallelism
2018 · Recommended next · Practice availablePartition layers across devices and split batches into microbatches for pipelined execution with gradient accumulation.
Practice GPipe - Megatron-LM
Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism
2019 · Recommended next · Practice availableDistribute attention and MLP matrix operations across devices, with column- and row-parallel linear layers as exercise components.
Practice Megatron-LM - ZeRO
ZeRO: Memory Optimizations Toward Training Trillion Parameter Models
2019 · Recommended next · Practice availableShard optimizer states, gradients, and parameters to progressively remove redundancy across data-parallel replicas.
Practice ZeRO
Attention and KV memory
- FlashAttention
FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
2022 · Practice availableUse tiling and online softmax to avoid storing the full attention matrix and reduce GPU memory accesses.
Practice FlashAttention - FlashAttention-2
FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
2023 · Practice availableImprove thread-block and warp work partitioning while reducing non-matmul operations and communication.
Practice FlashAttention-2 - GQA
GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints
2023 · Practice availableShare fewer key-value heads among groups of query heads to reduce inference cache memory.
Practice GQA - PagedAttention
Efficient Memory Management for Large Language Model Serving with PagedAttention
2023 · Practice availableMap noncontiguous KV cache blocks through block tables to support sharing and reduce fragmentation.
Practice PagedAttention
Inference scheduling and serving
- Orca
Orca: A Distributed Serving System for Transformer-Based Generative Models
2022 · Recommended next · Practice availableSchedule at generation-iteration granularity so requests can dynamically join and leave batches.
Practice Orca - SGLang
SGLang: Efficient Execution of Structured Language Model Programs
2023 · Recommended next · Practice availableUse RadixAttention to reuse prefix KV caches and optimize structured decoding.
Practice SGLang - Sarathi-Serve
Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Serve
2024 · Practice availableMix chunked prefill with decode scheduling to reduce the impact of long prompts on per-token latency.
Practice Sarathi-Serve - DistServe
DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving
2024 · Recommended next · Practice availableSeparate prefill and decode resources and parallelism settings to optimize goodput under latency constraints.
Practice DistServe
Quantization and efficient finetuning
- GPTQ
GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers
2022 · Recommended next · Practice availableUse approximate second-order information and error compensation for low-bit post-training quantization.
Practice GPTQ - SmoothQuant
SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Models
2022 · Practice availableApply equivalent per-channel scaling to shift the quantization difficulty of activation outliers into weights.
Practice SmoothQuant - AWQ
AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration
2023 · Recommended next · Practice availableUse activation statistics to identify important channels and equivalent scaling to protect low-bit weight quantization accuracy.
Practice AWQ - QLoRA
QLoRA: Efficient Finetuning of Quantized LLMs
2023 · Practice availableTrain LoRA adapters on a frozen 4-bit base model, using NF4, double quantization, and paged optimizers to save memory.
Practice QLoRA - SVDQuant
SVDQuant: Absorbing Outliers by Low-Rank Components for 4-Bit Diffusion Models
2024 · Practice availableAbsorb outliers in a high-precision low-rank branch and quantize the residual to 4 bits.
Practice SVDQuant