Project Type: Engineering / Distributed Systems
Code: GitHub Repository (branch: defence)
InferD is a framework for distributed inference of Large Language Models (LLMs) across a decentralized network of consumer-grade GPUs. Instead of requiring one massive server to hold the entire model, the model is split into pieces (stages), and different nodes in the network execute different parts of the computation graph.
The project synthesizes concepts from two key research areas:
The system operates as a Peer-to-Peer (P2P) network. There is no central master server controlling the inference.
We use a Kademlia DHT as the backbone for service discovery and state synchronization. Unlike centralized databases, the DHT is replicated across all participants.
What exactly is stored in the DHT? In InferD, the DHT stores the Routing Table, which maps Stage IDs to Node Addresses and their current Load:
{
"stage_0": [
{"node_id": "A", "ip": "192.168.1.5", "load": 0.2, "capacity": 10},
{"node_id": "B", "ip": "192.168.1.6", "load": 0.8, "capacity": 12}
],
"stage_1": [ ... ]
}
When a user sends a prompt, the request traverses the network “hop-by-hop”.
load metrics and selects the least loaded peer (greedy heuristic).One of the main features of InferD is its ability to adapt to network conditions.
The Problem: In a decentralized network, some stages might become bottlenecks (e.g., 10 nodes host Stage 1, but only 1 node hosts Stage 2).
The Solution (Balancer):
Each node runs a background Balancer process that periodically checks the global load distribution via DHT.
split_model.py automatically slices HuggingFace models (e.g., Qwen) into:
FirstStage: Embeddings + initial layers.StageInner: Middle transformer blocks.LastStage: Final layers + LM Head.PathFinder retries with a different peer. Dead nodes are eventually expired from the DHT.Powered by Jekyll and Minimal Light theme.