DualPipe from Scratch: Implementing DeepSeek's 5D Parallelism in PyTorch
summary
Implementation-first walkthrough of a PyTorch DualPipe reference that reproduces DeepSeek V3 at 2,048+ GPUs and explains the missing details: exact warm-up formula warmup = floor(P/2) + 2(M-1) that yields 3% bubble overhead and avoids deadlocks; why K_PE is shared across heads* in decoupled RoPE; bias update must run before routing and EMA init = 1/num_experts; sigmoid routing separates selection from gate weights; fix causal-mask offsets; hierarchical all-to-all halves inter-node traffic. Code and tests on github.com/DevJadhav/deepseek-from-scratch.
AI-written summary · about
chapters (17)
- 0:00DualPipe introduction
- 1:03What is DualPipe
- 4:36DualPipe in PyTorch
- 6:02Warm-up formula
- 7:25PyTorch schedule
- 8:30Async communication
- 9:32First silent bug
- 10:37Second silent bug
- 12:02Third silent bug
- 12:43Tensor parallelism
- 13:26Hierarchical all-to-all
- 14:28Fourth silent bug
- 15:32Fifth silent bug
- 16:13Three abstractions
- 17:19Benchmark results
- 18:25Why DualPipe matters
- 19:28Q&A
related talks
20mHetPipe: Enabling Large DNN Training on (Whimpy) Heterogeneous GPU Clusters through
16mRevisiting Pipeline Parallelism for LLM Serving
44mApropos DeepSeek
15mPipeThreader: Software-Defined Pipelining for Efficient DNN Execution
17mPPipe: Efficient Video Analytics Serving on Heterogeneous GPU Clusters via...
14mFlexPipe: Maximizing Training Efficiency for Transformer-based Models with...
29mAligning DeepSeek R1
14mFine-tuning giant neural networks on commodity hardware with automatic pipeline...
