A visual representation of distributed training sharding optimizer states across multiple GPUs.

Building a Mini GPT with ZeRO Stage 2 from Scratch in PyTorch

Learn how to implement a distributed training loop from scratch, mastering ZeRO Stage 2 and gradient accumulation to optimize memory and compute for large language models.

September 16, 2026 · 7 min · 1333 words · martinuke0
Diagram of GPU communication rings and tree collectives in NCCL

Inside NCCL Topologies: Collective Algorithms for Multi-GPU Training

Understanding NCCL topologies is essential for optimizing multi-GPU training performance. This post breaks down collective algorithms, hardware-aware patterns, and practical tuning tips.

September 16, 2026 · 2 min · 233 words · martinuke0
Diagram of mixed-precision AdamW with ZeRO-1 sharding across GPUs.

Building Mixed-Precision AdamW with ZeRO-1 from Scratch in Pure PyTorch

A runnable, from-scratch implementation of mixed-precision AdamW with dynamic loss scaling and ZeRO-1 sharded optimizer state in pure PyTorch — built to demonstrate real systems engineering, not just model design.

September 6, 2026 · 12 min · 2453 words · martinuke0

Optimizing Distributed Model Training on Bare‑Metal Clusters with RDMA and Low‑Latency Interconnects

Introduction Training state‑of‑the‑art deep‑learning models now routinely requires hundreds of GPUs working in concert. While public cloud providers offer convenient, on‑demand clusters, many research labs and enterprises still prefer bare‑metal clusters for three core reasons: Predictable performance – no noisy neighbors, no hypervisor overhead. Cost efficiency at scale – amortized CAPEX and lower per‑GPU price. Full control over hardware and software – ability to fine‑tune network stacks, install custom drivers, and leverage specialized interconnects. When you combine bare‑metal hardware with RDMA (Remote Direct Memory Access) and low‑latency interconnects such as InfiniBand or RoCE (RDMA over Converged Ethernet), you can dramatically reduce the communication overhead that traditionally limits distributed training speed. This article walks through the entire optimization stack—from networking fundamentals to concrete PyTorch code—so you can extract the maximum throughput from your cluster. ...

April 3, 2026 · 11 min · 2238 words · martinuke0

Architecting Low‑Latency Edge Networks for Decentralized Large Language Model Training and Inference

Introduction Large language models (LLMs) such as GPT‑4, LLaMA, and PaLM have demonstrated unprecedented capabilities in natural‑language understanding, generation, and reasoning. Their size—often measured in billions or even trillions of parameters—demands massive compute, storage, and network resources. Historically, training and inference for these models have been confined to centralized data centers equipped with high‑performance GPU clusters and ultra‑low‑latency interconnects (e.g., NVLink, InfiniBand). However, a growing class of applications—autonomous vehicles, real‑time translation on mobile devices, edge‑based recommendation engines, and privacy‑sensitive AI assistants—cannot tolerate the round‑trip latency of sending data to a distant cloud. They require low‑latency, high‑throughput edge networks that can host decentralized training and inference workloads. This shift presents a unique set of architectural challenges: ...

April 2, 2026 · 14 min · 2966 words · martinuke0
Feedback