Learn / DGX Spark Ray Cluster Setup

Ray cluster, part 1: decide and configure

Here's what to decide for Ray on two DGX Sparks, and what it splits for you. We're at the bottom of the stack: two machines, working over their own cable.

Chapters

  1. 0:00Introduction
  2. 0:06Where this fits: The AI stack
  3. 0:12Decision one: Pick the head node
  4. 0:19Decisions two and three: CPUs, GPUs, memory
  5. 0:39Decision four: pip, or containers
  6. 0:50What is split: Shared, and not shared
  7. 1:01How placing works: Fit first, then choose
  8. 1:16Strategies: DEFAULT or SPREAD
  9. 1:30Libraries: Splitting data work
  10. 1:42Know this: Requests are not load
  11. 1:52Wrap up
Read the transcript

Introduction

Here's what to decide for Ray on two DGX Sparks, and what it splits for you.

Where this fits: The AI stack

We're at the bottom of the stack: two machines, working over their own cable.

Decision one: Pick the head node

One Spark is the head. It also manages the cluster. If the head fails, the whole cluster fails.

Decisions two and three: CPUs, GPUs, memory

Ray counts each Spark's CPUs and GPUs. You can offer it fewer, to leave room for other work. By default it sets seventy percent of available memory for scheduling, and thirty for its object store. On a DGX Spark the processor and GPU share that memory, so leave room for your model.

Decision four: pip, or containers

With pip, you keep the versions matching on both Sparks yourself. With containers, one image holds the software. Pass in the token, and give them enough shared memory.

What is split: Shared, and not shared

Ray places tasks and actors, and moves their objects between the Sparks when needed. It doesn't pool the two memories, and it doesn't move an ordinary program.

How placing works: Fit first, then choose

Each task or actor asks for resources. A task asks for one CPU unless you say otherwise. Ray keeps only the nodes that could fit it. One task can't combine two Sparks. Then a strategy picks one of them.

Strategies: DEFAULT or SPREAD

The default strategy doesn't promise an even split. By our reading, a small batch may stay on one Spark. Spread tries to put tasks on different nodes. A strict spread placement group requires separate nodes.

Libraries: Splitting data work

Ray Data cuts a dataset into blocks, and works on them in parallel. Files need to be reachable from the nodes that read them, such as a shared filesystem at the same path.

Know this: Requests are not load

Those CPU numbers are requests, not measurements. Ray doesn't stop a task using more. So watch the real load on each Spark as well.

Wrap up

Keep it private, whatever you choose. Part two sets the cluster up.

Sources

More lessons