From Deadlocks to DDP: My Journey Building a 3-Node PyTorch Cluster

When you are training deep learning models, you inevitably hit a wall where a single GPU just isn’t cutting it anymore. The industry standard for scaling compute across multiple machines is PyTorch’s Distributed Data Parallel (DDP). But reading the documentation is one thing; actually building a distributed network from scratch is a completely different beast. I didn’t want to just rent a cloud cluster. I wanted to understand the absolute lowest-level plumbing of how computers talk to each other to solve math. So, I decided to build a local simulation lab. No fancy Kubernetes, no Slurm workload managers—just pure Debian Virtual Machines, a local network bridge, and a lot of debugging. ...

March 28, 2026 · 6 min · 1221 words · Chinmay Dharmik

Understanding Attention: Implementing a Transformer from Scratch in PyTorch

Understanding Attention: Implementing a Transformer from Scratch in PyTorch When Vaswani et al. published “Attention Is All You Need” in 2017, it completely shifted the landscape of Natural Language Processing. The paper introduced the Transformer architecture, which aggressively discarded recurrent connections in favor of a self-attention pipeline. In this blog post, we walk through the critical steps of rebuilding that original mathematical breakthrough from scratch in PyTorch. 1. Discarding Recurrence: The Need for Positional Encoding Because Transformers process tokens in parallel rather than sequentially, the model inherently lacks an understanding of order. How does it know that the word “dog” came before “bites”? ...

January 24, 2026 · 3 min · 568 words · Chinmay Dharmik