Inference of LLM on a Cluster of Old Laptops
Meta
Alibaba/Qwen
OpenAI
An experiment tested distributed LLM inference across three old laptops using llama.cpp's RPC protocol. Results show that distributed inference only provides a significant speedup when the model does not fit into a single node's memory; for smaller models, the network overhead makes a single fast node faster. The test also revealed that prompt processing benefits from parallelism, while token generation does not.
An experiment was conducted to test distributed LLM inference on a cluster of three old laptops with Intel CPUs from different generations: Core i7-4700MQ (Haswell, 2013), Core i5-8265U (Whiskey Lake, 2018), and Core i3-1115G4 (Tiger Lake, 2020), totaling 52 GB of RAM. The software used was llama.cpp (build b10069) with a RPC server on each node, and the nodes were connected via gigabit Ethernet. The models tested were Llama-3.2-1B-Instruct, Llama-3.1-8B-Instruct, Qwen2.5-32B-Instruct (all Q4_K_M), and gpt-oss-20b (MoE). For the 1B model, the cluster (i3+i5) gave 22.5 t/s token generation vs 29.2 t/s on the best solo node (i3), a 23% slowdown. For the 8B model, the cluster was nearly at parity with solo (4.6 vs 4.9 t/s), but prompt processing was almost 3x faster (10.9 vs 3.9 t/s). For the 32B model, which did not fit in any single node, the cluster achieved 1.1 t/s versus 0.3 t/s on a node with swapping, a 268% improvement. With the MoE model gpt-oss-20b, which also did not fit on a single node, the cluster gave stable 8.0-8.1 t/s generation and prompt eval of 15.4-15.9 t/s, compared to unstable solo performance. The conclusion is that distributed inference is only justified when the model does not fit into one node; otherwise, a single fast node is better. Also, prompt processing benefits from parallelism, while token generation does not, and any weak node can bottleneck the cluster.
- Abbreviations
- CPU = Central Processing Unit — центральный процессор
- RAM = Random Access Memory — оперативная память
- DDR3 = Double Data Rate 3 — тип оперативной памяти DDR3
- DDR4 = Double Data Rate 4 — тип оперативной памяти DDR4
- AVX2 = Advanced Vector Extensions 2 — набор инструкций AVX2
- FMA = Fused Multiply-Add — инструкция FMA
- F16C = 16-bit Floating-Point Conversion — инструкция F16C
- RPC = Remote Procedure Call — удаленный вызов процедур
- TCP = Transmission Control Protocol — протокол TCP
- RTT = Round-Trip Time — время кругового обхода
- GGUF = GPT-Generated Unified Format — формат файлов модели GGUF
- MoE = Mixture of Experts — смесь экспертов
- LTS = Long-Term Support — долгосрочная поддержка
- Wi-Fi = Wireless Fidelity — беспроводная сеть
- GHz = Gigahertz — гигагерц
- GB = Gigabyte — гигабайт
- B = Byte — байт
- t/s = tokens per second — токенов в секунду
- VRAM = Video Random Access Memory — видеопамять
- RAM = Random Access Memory — оперативная память
- KV-cache = Key-Value cache — кэш ключ-значение
- OS = Operating System — операционная система
- CPU = Central Processing Unit — центральный процессор
Source: Habr — хаб ML —
original
