Block XI · Expert level · Lesson 63
Clusters: link several machines for bigger models
You'll understand when linking machines adds memory and when it also adds speed: splitting layers versus splitting tensors, and what connection you need (RDMA over Thunderbolt 5 on Mac, NVLink or InfiniBand).
- 10 min
- 9 animated slides
- 4-question quiz
- Narrated in 6 languages
What you'll see in this lesson
- Why connect several machines
A model only runs well if it fits entirely in memory; connecting machines adds up that memory to run models that don't fit in one.
- Splitting layers: adds memory, not speed
In layer parallelism, or pipeline, each machine holds one section of the model and they work in turns, one after another.
- Splitting tensors: also adds speed
In tensor parallelism, each layer is split across all the machines, which compute their part at the same time and combine the result.
- The connection decides if you gain speed
For splitting layers almost any network will do; for splitting tensors you need lots of bandwidth and, above all, low latency.
- exo: a Mac cluster with almost no setup
exo finds the machines on your network, decides how to split the model and offers a dashboard and an API on port 52415.
- llama.cpp RPC: mix the machines you already have
With llama.cpp's RPC mode, a PC with an NVIDIA card, a Mac and another PC can share the layers of the same model.
- vLLM: tensors in the node, layers across nodes
vLLM splits a model across several GPUs with --tensor-parallel-size and across several servers with --pipeline-parallel-size.
- When it's worth it and when it isn't
A cluster pays off when the model doesn't fit in any machine you can buy; if it fits in one, a single machine is almost always better.
- Summary: clusters for local AI
Connecting machines always adds memory; it only adds speed if you split tensors and the connection is very fast.
Tools and concepts
- exo
- llama.cpp RPC
- Tensor parallel
- RDMA TB5
Sign in with your Google account to access this lesson and the whole course.
More lessons in this block
- Autonomous agents: 7 GitHub repos for delegating tasks to AI
- Build your own AI apps: no-code, RAG and self-hosted platforms
- Coding agents and skills: the repos everyone installs
- Open-source AI for video, image and audio: 7 GitHub repos
- Scraping and research agents: 7 repos to read the internet with AI
- Train your own model
- Mega-lists and GitHub repos to learn AI (plus marketing skills)