PyTorch3 articles

PyTorch

Articles

  • GPU Memory Profiling in Production LLM Serving: CUDA Allocator Internals, PyTorch Snapshots, and VRAM Optimization

    In high-throughput large language model serving, memory is the primary constraint governing latency, batch concurrency, and context length. While model parameter footprints are static and easily calculated, runtime GPU memory (VRAM) dynamics are governed by low-level caching allocators, dynamic key-value (KV) cache allocation pools, transient activation spikes, and memory fragmentation. When an inference worker crashes with torch.cuda.OutOfMemoryError, default system diagnostics such as nvidia-

    1 min
  • Distributed Checkpointing in Production: PyTorch DCP, Asynchronous Staging, and Dynamic Topology Resharding

    Distributed Checkpointing in Production: PyTorch DCP, Asynchronous Staging, and Topology Resharding In multi-node distributed deep learning, checkpointing is often the largest single source of unforced downtime and degraded Model Flops Utilization (MFU). As models scale to tens or hundreds of billions of parameters across thousands of GPUs, saving model weights and optimizer states using traditional serialization primitives creates severe cluster stalls, memory exhaustion on root ranks, and rig

    1 min
  • Fully Sharded Data Parallel (FSDP) and ZeRO: How Memory Sharding Eliminates Redundant Model States in Distributed Training

    Fully Sharded Data Parallel (FSDP) and ZeRO: How Memory Sharding Eliminates Redundant Model States in Distributed Training Training large language models across distributed GPU clusters introduces a fundamental memory bottleneck. In traditional Distributed Data Parallel (DDP) setups, every GPU maintains an identical copy of model weights, optimizer states, and gradients while processing independent data batches. As models scale from billions to hundreds of billions of parameters, static model s

    1 min