Learn / DGX Spark Cluster Tax

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

  1. 0:00Introduction
  2. 0:05Where this fits: The AI stack
  3. 0:09What a cluster is: Two computers, not one
  4. 0:17NVIDIA's figures: Memory and the link
  5. 0:30Two ways: Split, or copies
  6. 0:39A split model: The cluster tax
  7. 0:54How it splits: Tensor or pipeline
  8. 1:08Two copies: Not twice as fast
  9. 1:22If one stops: What survives
  10. 1:32Where Ray fits: What Ray adds
  11. 1:40Your own case: Measure it
  12. 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

More lessons