Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 14 min read Research hardMaster

Deep Learning over the Internet: Training Language Models Collaboratively

DeDLOC is a collaborative distributed training method that lets volunteers with heterogeneous GPUs and home Internet connections jointly pretrain language models. It accumulates one very large batch across all peers before each optimizer step, which tolerates peers joining and leaving, and uses an adaptive All-Reduce that splits gradient aggregation by each peer's bandwidth and reachability (firewalled nodes only send). Applied to sahajBERT, an ALBERT-large Bengali model trained by 40 volunteers plus 16 preemptible T4 instances over 234 cumulative days, it reached near state-of-the-art downstream quality. The write-up also covers the Bengali-specific tokenizer pipeline and streaming datasets so peers can start training immediately.

Assumes: data-parallel traininggradient accumulationAll-ReduceTransformer pretraining

Related posts

  • Distributed Training: Train BART/T5 for Summarization using 🤗 Transformers and Amazon SageMaker

    Hugging Face mediumAdept

    BART-large-CNN can be fine-tuned for dialogue summarization on the SAMSum dataset with distributed data-parallel training on Amazon SageMaker, using the Hugging Face estimator and the Transformers Deep Learning Containers. Enabling smdistributed data parallelism takes one `distribution` parameter, and the job reuses the stock run_summarization.py example script pulled from Git. On 2 ml.p3dn.24xlarge instances (16 GPUs, total batch size 64), three epochs take about 24 minutes and cost roughly $28, reaching validation ROUGE-1 of about 42.6. The walkthrough ends by downloading the model from S3, generating a model card with metrics, and pushing it to the Hugging Face Hub for hosted inference.

  • Ulysses Sequence Parallelism: Training with Million-Token Contexts

    Hugging Face hardMaster

    Ulysses Sequence Parallelism, part of Snowflake's Arctic Long Sequence Training protocol, enables training on contexts of hundreds of thousands to millions of tokens. Each GPU holds a shard of the sequence, and all-to-all collectives regroup the data so each GPU computes attention over every position for a subset of heads. That costs O(n·d/P) communication per GPU, versus O(n·d) over P−1 serial hops for Ring Attention. Ulysses is now integrated into Hugging Face Accelerate (ParallelismConfig with a DeepSpeed backend), the Transformers Trainer and TRL's SFTTrainer, which handle dataloader sharding, shifted labels and token-weighted loss aggregation automatically. Practical guidance covers padding to a multiple of sp_size, the num_heads ≥ sp_size constraint, choosing FlashAttention versions, ZeRO-3 offload, expandable_segments, Liger-Kernel, and balancing SP against DP across GPU counts.

  • Async GRPO with LoRA across HF Jobs: a bucket, a proxy, and no NCCL

    Hugging Face hardMaster

    TRL v1.14's AsyncGRPOTrainer can train a LoRA adapter and sync only that adapter to vLLM, which lets the trainer and inference replicas run as separate Hugging Face Jobs on separate machines without NCCL. A rank-1 adapter for a 1.5B model is a few megabytes, so it travels through a Storage Bucket mounted at the same path in every Job, and vLLM loads it via /v1/load_lora_adapter. Versioned adapter names and max_staleness+2 adapter slots keep in-flight rollouts on their original policy and stop prefix-cache reuse across weight versions. A small proxy adds the auth header, broadcasts adapter loads, pause and resume to every replica, and routes the G=8 rollouts of each prompt to the replica holding their KV prefix using adapter-seeded chained block hashes. Using the AsyncGRPO metrics to find bottlenecks, five runs cut the same 500-step recipe from 3 h 27 min to 53 min.

  • Swarms, Flocks, Gangs: How to build, train, and evaluate multi-agent systems

    Hugging Face hardMaster

    Four agents sharing one Qwen3-0.6B policy learn to pool private numbers and submit a sorted list, trained with GRPO-style group-normalized team rewards that penalize token use. Over 75 updates, training success rose from 6.6% to 82.3% (81.25% on held-out problems) while generated tokens per team fell 37.4%, with broadcasts replacing direct messages. The trained team beat an untrained best-of-8 baseline (37.5%) at about 1/13 the tokens. The post frames multi-agent systems as a Dec-POMDP with credit-assignment and non-stationarity problems, argues swarms must be compared at matched compute budgets, and gives a reproducible TRL plus vLLM script for Hugging Face Jobs on two H200s (about $50).

  • Pre-Train BERT with Hugging Face Transformers and Habana Gaudi

    Hugging Face mediumAdept

    BERT-base can be pre-trained from scratch with masked-language modeling on an AWS DL1 instance (Habana Gaudi), using Hugging Face Transformers, Datasets and Optimum Habana. The workflow merges BookCorpus and Wikipedia, trains a 32k-vocab tokenizer, and packs the text into 512-token chunks on a CPU instance. Training then runs data-parallel across 8 HPUs by swapping Trainer for GaudiTrainer, launched remotely with EC2 Remote Runner. 100k steps at global batch 256 took about 12.5 hours, which projects a full 1M-step pre-training to roughly $1,650. That is about 25% cheaper than a DeepSpeed V100 baseline estimated at around $2,075.

The quest for software engineering knowledge.

Look:
Layout: