Problem

Fine-tuning a 2.7B-parameter model usually needs one big GPU. Our team of 3 asked whether three free Colab GPUs could do the job together instead, without ever sending full model weights between them. The project is also known by its repo name, peft-distributed.

How it works

  • LoRA on a frozen base. Phi-2’s weights stay frozen; each node trains only LoRA adapters (rank 16, alpha 32) on the attention and MLP layers, using an Alpaca-style instruction dataset.
  • Each node owns a slice of the model. Node A trains layers 0 to 10, node B layers 11 to 21, and node C layers 22 to 31 plus the output head.
  • Rounds through the Hub. After each round, every node uploads its adapter to Hugging Face Hub and reports to an aggregator. An adapter update is 2 to 5 MB, against 200 to 500 MB for a full set of weights.
  • Merging. When all three nodes have reported, the aggregator builds the next round’s adapter. Each layer comes from the node that owns it, since the other nodes’ copies of that layer are untrained, and anything that doesn’t belong to a numbered layer is averaged across all three (federated averaging, or FedAvg).

The aggregator is a FastAPI service in Docker on a Hugging Face Space, with a Gradio dashboard showing each node’s status, a per-round loss table and convergence plots. It checks a shared secret on every submission, rejects reports for the wrong round, rate-limits submissions and has its own test suite.

My part: evaluation

I owned the evaluation pipeline and the plots: measuring perplexity each round, comparing it with a LoRA run of the same model on a single machine, and charting convergence.

Model Perplexity
Before fine-tuning 20.91
After 5 rounds, distributed 1.27
Single-machine LoRA baseline 1.36

The distributed run fell below the single-machine baseline from round 2 on.

What I’d do next

  • Add a held-out benchmark alongside perplexity, so the comparison covers answer quality, not just fit.
  • Measure wall-clock time and Hub traffic per round against the single-machine run, to put a number on the cost side.
  • Try averaging every layer across nodes, instead of layer ownership, to see which merge works better.