TLDRocket
Sign in

Tools & Coding

975 summarised stories in Tools & Coding, each linking back to the original source. Browse all topics →

Monday, 2 May 2022

Accelerate Large Model Training using PyTorch Fully Sharded Data Parallel

Hugging Face 4 years ago 12

PyTorch's Fully Sharded Data Parallel (FSDP) feature, integrated into the Accelerate library, enables training of large models by distributing parameters and gradients across multiple GPUs without requiring code changes. On two 24GB GPUs, FSDP allowed batch sizes of 22 for the 762M-parameter GPT-2 Large model compared to batch size 7 with standard distributed data parallel, and successfully trained the 1.5B-parameter GPT-2 XL model with batch size 14 when using CPU offloading, whereas standard methods ran out of memory. Users can now train large models on minimal hardware by adjusting the minimum parameter threshold for layer wrapping and enabling CPU offloading, though they must prepare the model before creating the optimizer to avoid memory waste.

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.