Cluster tax, part 1: why two is not twice
Why don't two DGX Sparks give twice the throughput? We're at the bottom: the machines, and their cable. A cluster of two Sparks is still two computers.
Chapters
- 0:00Introduction
- 0:05Where this fits: The AI stack
- 0:09What a cluster is: Two computers, not one
- 0:17NVIDIA's figures: Memory and the link
- 0:30Two ways: Split, or copies
- 0:39A split model: The cluster tax
- 0:54How it splits: Tensor or pipeline
- 1:08Two copies: Not twice as fast
- 1:22If one stops: What survives
- 1:32Where Ray fits: What Ray adds
- 1:40Your own case: Measure it
- 1:48Wrap up
Read the transcript
Introduction
Why don't two DGX Sparks give twice the throughput?
Where this fits: The AI stack
We're at the bottom: the machines, and their cable.
What a cluster is: Two computers, not one
A cluster of two Sparks is still two computers. A network link joins them. It doesn't merge their memory.
NVIDIA's figures: Memory and the link
NVIDIA lists two hundred seventy three gigabytes a second of memory bandwidth in each Spark. Each fast port provides up to two hundred gigabits a second. That's twenty five gigabytes a second.
Two ways: Split, or copies
You can split one model across both. That can make room for a model too big for one. Or, if it fits on one, run a copy on each.
A split model: The cluster tax
When split, the Sparks must send each other data, over a link much slower than their memory. They wait for each other, so the slower one sets the pace. And each one carries its own software, which uses memory and processor time.
How it splits: Tensor or pipeline
Tensor parallel divides each layer, so the Sparks exchange partial results at every layer. Pipeline parallel gives each one some layers. Less is exchanged, but the stages depend on each other in turn.
Two copies: Not twice as fast
Two copies avoid most of that tax. But one reply is still made by one Spark, so it isn't twice as fast. The second copy only adds throughput when one Spark has more requests than it handles well.
If one stops: What survives
If a split model loses a Spark or the link, expect it to stop. With copies, the other can carry on, if the balancer is still running and notices.
Where Ray fits: What Ray adds
Ray places and coordinates work. It doesn't merge their memory, or make data cross the cable any faster.
Your own case: Measure it
So measure one Spark against two, with the same requests. Try one request at a time, then many at once.
Wrap up
If it fits, try copies first. Next, what both Sparks need.
Sources
- docs.nvidia.com/dgx/dgx-spark/hardware.html
- docs.nvidia.com/dgx/dgx-spark/spark-clustering.html
- docs.nvidia.com/deeplearning/nccl/user-guide/docs/usage/collectives.html
- docs.vllm.ai/en/latest/serving/parallelism_scaling
- docs.vllm.ai/en/latest/configuration/optimization
- huggingface.co/docs/transformers/main/en/perf_infer_gpu_multi
- docs.ray.io/en/latest/cluster/key-concepts.html
- docs.ray.io/en/latest/ray-core/scheduling/index.html