Learn / DGX Spark Cluster

Two copies on two DGX Sparks, part 1: decide and configure

Two DGX Sparks, a whole model on each. Here's what to decide first. We're starting from the machines: two DGX Sparks, joined by their cable.

Chapters

  1. 0:00Introduction
  2. 0:06Where this fits: The AI stack
  3. 0:13What is shared: Requests are shared. Not much else
  4. 0:26Balancing: Pick a method
  5. 0:43If one stops: Failover is partial
  6. 1:01Settings: Match both copies
  7. 1:15Wrap up
Read the transcript

Introduction

Two DGX Sparks, a whole model on each. Here's what to decide first.

Where this fits: The AI stack

We're starting from the machines: two DGX Sparks, joined by their cable.

What is shared: Requests are shared. Not much else

A load balancer shares new requests. Each one runs wholly on one Spark. Its CPU work goes there too, such as turning text into tokens. Model memory, caches, files and settings stay separate.

Balancing: Pick a method

With no method line, NGINX takes the servers in turn. That's round robin. Least connections picks the server with fewer open. This guide starts there. IP hash follows the caller's address. Through an SSH tunnel, all callers look alike.

If one stops: Failover is partial

After repeated failures, NGINX leaves a server out for a while. A chat request already sent to a stopped Spark isn't passed on by default. A reply that has started can't move to the other Spark. And if the first Spark stops, the one address stops with it.

Settings: Match both copies

Use the same image, model, version and settings on both Sparks. Use the same API key on both. It protects some paths, not all. Docker doesn't restart these containers after a reboot unless you ask.

Wrap up

Part two sets it up, checks it, and stops it.

Sources

More lessons