executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
distributed-trainingDistributed Training Optimization
Independent GitHub snapshot · Automated classification · Original documentation governs
Synchronous data parallel training requires gradients from all GPUs to be averaged before the optimizer step. Instead of a parameter server bottleneck, Ring All-Reduce organizes N GPUs into a logical ring. The gradient tensors are split into N chunks. During the scatter-reduce phase, GPUs pass chunks around the ring, accumulating sums. After N-1 steps, each GPU holds one fully accumulated chunk. In the subsequent all-gather phase, these complete chunks are circulated. Total network transfer per GPU is 2*(N-1)/N * Size, making it bandwidth-optimal and highly scalable.
Standard Data Parallelism duplicates the entire model state across all GPUs, which is impossible for LLMs like GPT-3. ZeRO eliminates this memory redundancy by partitioning the state.
flowchart TD
%%{init: {"theme": "default", "flowchart": {"useMaxWidth": true}}}%%
subgraph CommunicationRingAllReducePhase ["Ring All-Reduce Phase<br><br><br>"]
GPU_0 -->|"send_chunk()"| GPU_1
GPU_1 -->|"accumulate()"| GPU_2
GPU_2 -->|"forward()"| GPU_0
end
subgraph ZeROStagesZeROPartitioning ["ZeRO Partitioning<br><br><br>"]
Stage1 -->|"partition_adam()"| MemorySave
Stage2 -->|"partition_grads()"| ReduceScatter
Stage3 -->|"partition_weights()"| AllGather
end