Learn / DGX Spark Cluster

Split model on two DGX Sparks, part 2: set up, check and stop

Now let's start a split model with vLLM. We haven't run these steps on hardware. Use the same image on both Sparks. Check it lists the node options.

Chapters

  1. 0:00Introduction
  2. 0:07Both Sparks: Check the image
  3. 0:12Both Sparks: Open a container
  4. 0:27Inside each: Start both ranks
  5. 0:37Check: Is it really split?
  6. 0:50Security: Check open ports
  7. 1:01Stop: Stop both
  8. 1:12Wrap up
Read the transcript

Introduction

Now let's start a split model with vLLM. We haven't run these steps on hardware.

Both Sparks: Check the image

Use the same image on both Sparks. Check it lists the node options.

export IMAGE="YOUR-VLLM-IMAGE:TAG"
docker run --rm --gpus all --entrypoint vllm \
  "$IMAGE" serve --help=all | grep -- --nnodes

Both Sparks: Open a container

These containers get wide control of each Spark, so only run images you trust. Give each its own link address, and the first Spark's address as the head. Name the cluster network interface. The full command is on the page.

Inside each: Start both ranks

This loads both GPUs, so check nothing important is running. Start rank zero first. Then start rank one on the second Spark, headless.

vllm serve ORG/MODEL --tensor-parallel-size 2 \
  --nnodes 2 --master-addr "$HEAD_IP" \
  --host localhost --node-rank 0
vllm serve ORG/MODEL --tensor-parallel-size 2 \
  --nnodes 2 --master-addr "$HEAD_IP" \
  --host localhost --node-rank 1 --headless

Check: Is it really split?

Wait for the first Spark to say startup is complete. Check its health, then send a short chat request. Watch both GPUs while it answers. Then note your own speed as a baseline.

Security: Check open ports

Setting the API host doesn't cover the ports the nodes use between themselves. While it runs, list the listening ports, and let only the other Spark reach the internal ones.

Stop: Stop both

Stopping ends every reply. Press Control C in both terminals, then leave each container. Or stop the container from another terminal, on each Spark.

exit
docker stop vllm_cluster

Wrap up

The page also has the SGLang commands, and fixes by symptom.

Sources

More lessons