Playbook · DGX Spark cluster

PyTorch distributed on two DGX Sparks with torchrun.

PyTorch's own tools run one program across both Sparks, mainly for training and fine-tuning.

PyTorch's distributed traffic has no sign-in and no encryption. PyTorch says anyone with network access to it can run code as your user. Use it only on a network you fully control.

How to run torchrun across two DGX Sparks

  1. Open the same PyTorch container on both Sparks with host networking.
  2. Tell PyTorch to use the cluster interface.
  3. Run the same torchrun command on both: two nodes, one process each, the same rendezvous address.
  4. Check with a tiny all-reduce before your real training job.

Checked on 26 November 2026 against: PyTorch 2.15 torchrun and distributed documentation, PyTorch's security policy and NVIDIA's PyTorch fine-tuning playbooks. We have not yet run this playbook start to finish on our own hardware.

Watch, then follow

How to set up PyTorch distributed on two DGX Sparks, in two parts.

Part 1 of 2: Decide and configure

Video, part 1: Decide and configure. It covers: Share the model; Done, or your job; Divide the samples; It stays on its Spark; Data workers. Chapters and transcript
Read the words of this video

Decide, then configure. Before you run PyTorch on two DGX Sparks, here's what to decide.

The AI stack. We start at the bottom of the stack, with two machines that must run one job.

Share the model. With DDP, each Spark holds a full copy of the model. FSDP can shard it instead, so each holds part of the weights and training state.

Done, or your job. torchrun starts processes on its own Spark, and numbers them. DDP combines gradients. Your code must pick the GPU, divide the data, and save checkpoints.

Divide the samples. DDP doesn't divide your data. Use a distributed sampler with your data loader. Set the epoch each time round, or the shuffled order repeats. The batch size is per process, so two Sparks take twice as many samples each step.

It stays on its Spark. CPU work doesn't move between Sparks. Threads and data workers use their own Spark's processor. With one process on each, torchrun leaves the thread setting as it was. With more than one, and nothing set, it sets one thread each.

Data workers. Data loader workers start at zero, so the training process loads the data itself. Add workers in small steps. Each uses processor time and memory. In a container, give them enough shared memory.

Decide, then measure. The page lists every setting and its default. We haven't run this on hardware.

Slides for this part, at your own pace:

10 steps

  1. Diagram for step 1, Copy or shard the model: Share the model
    Diagram: Share the model, for step 1

    Decide

    1. Copy or shard the model

    With DDP, each process holds a full copy. FSDP with full sharding splits parameters, gradients and optimizer state. Your script or training library has to set up either.

    All the decisions

  2. Diagram for step 2, Know what is automatic: Done, or your job
    Diagram: Done, or your job, for step 2

    Decide

    2. Know what is automatic

    torchrun starts and numbers the processes. DDP combines gradients. Start torchrun on both Sparks yourself.

    What is split, and what is not

  3. Diagram for step 3, Know what your code must do: Done, or your job
    Diagram: Done, or your job, for step 3

    Decide

    3. Know what your code must do

    Use LOCAL_RANK to pick the GPU, divide the data, and save checkpoints where both Sparks can read them before a resume.

    The shape of a training script

  4. Diagram for step 4, Divide the samples: Divide the samples
    Diagram: Divide the samples, for step 4

    Configure

    4. Divide the samples

    DDP does not divide your input. Pass a DistributedSampler to the DataLoader as its sampler, without shuffle=True.

  5. Diagram for step 5, Set the epoch: Divide the samples
    Diagram: Divide the samples, for step 5

    Configure

    5. Set the epoch

    Call this at the start of each epoch, before looping over the loader.

    sampler.set_epoch(epoch)
  6. Diagram for step 6, Count the whole batch: Divide the samples
    Diagram: Divide the samples, for step 6

    Configure

    6. Count the whole batch

    batch_size is per process. With two processes, one step covers twice as many samples.

  7. Diagram for step 7, Check the thread settings: It stays on its Spark
    Diagram: It stays on its Spark, for step 7

    Configure

    7. Check the thread settings

    Run this in the container on each Spark. With one process on each, torchrun leaves OMP_NUM_THREADS as it was. With more than one and nothing set, it sets 1.

    python3 -c 'import os, torch; print(os.cpu_count(), torch.get_num_threads(), os.environ.get("OMP_NUM_THREADS"))'

    CPU settings and defaults

  8. Diagram for step 8, Start data workers from the default: Data workers
    Diagram: Data workers, for step 8

    Configure

    8. Start data workers from the default

    num_workers is 0 unless you set it: the training process loads the data.

  9. Diagram for step 9, Add workers in steps: Data workers
    Diagram: Data workers, for step 9

    Configure

    9. Add workers in steps

    Each uses CPU and memory, on its own Spark only. Measure after each change.

  10. Diagram for step 10, Give workers shared memory: Data workers
    Diagram: Data workers, for step 10

    Configure

    10. Give workers shared memory

    Keep --ipc=host in the container command, or set a larger --shm-size.

    torchrun settings and defaults

Part 2 of 2: Set up, check and stop

Video, part 2: Set up, check and stop. It covers: A private network; Same container; One command; Look for two; Start small; Stopping loses work. Chapters and transcript
Read the words of this video

Set up, check, stop. Now let's run a small check across both Sparks.

A private network. PyTorch's distributed traffic has no sign-in and no encryption. Anyone who can reach it can run code as your user, so use only a network you control.

Same container. Save the small check script on both Sparks. Open the same PyTorch container on each. It uses the Spark's own network, and your work folder. Set the head address to the first Spark, and name the cluster interface.

One command. Run the same torchrun command on both. It asks for two nodes, one process each. Start the first, then promptly the second.

Look for two. Each side should say a world size of two. And each should show a sum of two. If it waits, check the address, port, job name and link.

Start small. Try your own script on a small piece of data. Watch the GPU, processor and memory on both. Change one setting at a time, and compare the same number of steps. Test that you can resume from a checkpoint, and that both Sparks can read it.

Stopping loses work. Stopping loses work since the last checkpoint. Press control C on both, check the GPU is free, then leave each container. To undo, delete the check script. The container removes itself.

Check first. The written page has the commands, fixes and sources.

Slides for this part, at your own pace:

10 steps

  1. Diagram for step 1, Use a private network only: A private network
    Diagram: A private network, for step 1

    Set up

    1. Use a private network only

    PyTorch distributed has no sign-in and no encryption.

    Anyone with access to this traffic can run code as the user running PyTorch.

  2. Diagram for step 2, Save the check script on both: Same container
    Diagram: Same container, for step 2

    Set up

    2. Save the check script on both

    Save check_link.py in an empty folder on each Spark.

    The script, on this page

  3. Diagram for step 3, Open the same container on both: Same container
    Diagram: Same container, for step 3

    Set up

    3. Open the same container on both

    The container uses the Spark's own networks and can change the folder you mount. Use images and code you trust.

    Set HEAD_IP, ETH_IF and PT_IMAGE, then open the container from your work folder, as the page shows.

    The whole command

  4. Diagram for step 4, Run the same command on both: One command
    Diagram: One command, for step 4

    Set up

    4. Run the same command on both

    First Spark first, then promptly the second.

    torchrun --nnodes=2 --nproc-per-node=1 \
      --rdzv-id=spark-check --rdzv-backend=c10d \
      --rdzv-endpoint="$HEAD_IP:29400" \
      check_link.py
  5. Diagram for step 5, Look for a sum of 2.0: Look for two
    Diagram: Look for two, for step 5

    Check

    5. Look for a sum of 2.0

    Each terminal should print one line with its host name, its rank of 2, and sum = 2.0.

  6. Diagram for step 6, If it waits, compare the two: Look for two
    Diagram: Look for two, for step 6

    Check

    6. If it waits, compare the two

    Check the first Spark's link address, the port, the job name and the ping between them. Set NCCL_DEBUG=INFO to see more.

    Fixes by symptom

  7. Diagram for step 7, Try your own script, small: Start small
    Diagram: Start small, for step 7

    Check

    7. Try your own script, small

    Watch GPU, processor and memory on both Sparks while it runs.

    nvidia-smi
    top
  8. Diagram for step 8, Test a resume: Start small
    Diagram: Start small, for step 8

    Check

    8. Test a resume

    Load only checkpoints your own jobs wrote. Loading a distributed checkpoint can run code.

    Save a checkpoint, make it readable on both Sparks, and resume from it before a long run.

  9. Diagram for step 9, Stop on both: Stopping loses work
    Diagram: Stopping loses work, for step 9

    Stop

    9. Stop on both

    Stopping a job loses work since its last checkpoint.

    Press Ctrl+C on both, check nvidia-smi, then type exit in each container.

  10. Diagram for step 10, Remove what you added: Stopping loses work
    Diagram: Stopping loses work, for step 10

    Undo

    10. Remove what you added

    Delete check_link.py. The --rm option removes the container when it exits.

    Stop and undo, in full

Is this the one?

When should you use PyTorch distributed?

Best for

Training or fine-tuning across both Sparks, or your own program written for more than one machine.

Strengths

Part of PyTorch. One launcher, torchrun, starts and watches the processes. Training libraries such as Accelerate build on the same base.

Drawbacks

It is not a model server. The script must be written for distributed running. Both nodes must stay up, and communication can limit speed: PyTorch notes that four GPUs in one machine train faster than four machines with one GPU each.

Compare all five in the cluster method chooser.

Before you start

What you need first.

Two DGX Sparks on the same current DGX OS, with the cable link set up and tested as in the cluster setup guide. In the commands, my-spark is the first Spark, spark-two the second, and USER your user name. Replace words in capitals with your own values. Nothing on this page has been run by us on hardware.

Docker with GPU access on both Sparks, and the same PyTorch container tag on both. NVIDIA's playbooks use images from nvcr.io/nvidia/pytorch; take the tag the current playbook names. Passing the NCCL test in the cluster guide first saves time.

How it fits together

One torchrun on each Spark, one shared job.

torchrun on my-sparkmeeting point, port 29400torchrun on spark-twojoins the meeting pointOne processone GPUOne processone GPUdata exchanged over the cable
Each Spark has one GPU, so each runs one process. Both meet at the first Spark. Our own drawing.

Decide first

What to decide before you run torchrun on two nodes.

Settings in the next four sections were checked on 27 November 2026 against the PyTorch 2.15 documentation, and where it says so, the 2.15.0 source. None of them has been run by us on DGX Spark hardware.

DecisionYour choicesHow to decide
How the model uses two GPUsDistributedDataParallel (DDP), or FullyShardedDataParallel (FSDP)With DDP each process holds its own full copy of the model, so the model and its training state must fit on one Spark. FSDP with full sharding splits parameters, gradients and optimizer state between the processes. Either one needs your script, or your training library, to set it up.
Backendnccl or glooPyTorch says to use NCCL for training on CUDA GPUs, and Gloo for CPU training; Gloo is also its fallback if NCCL gives trouble on Ethernet. Use nccl for GPU training on two Sparks.
Processes on each Spark--nproc-per-nodeA DGX Spark has one GPU, and DDP expects one process for each GPU. So this page uses 1.
How the two meetc10d or static rendezvousPyTorch recommends c10d, which hands out ranks. With static, the default, you give each machine its own --node-rank.
Fixed or changing size--nnodes=2 or a range such as 1:2Keep 2 unless your script can resume from a checkpoint with a different number of processes. When membership changes, all surviving workers are killed and a new group starts.
Restarts--max-restartsThe default is 0. A restart only helps if your script loads its last checkpoint at start-up.
CPU threads and data workersTwo separate settingsSee CPU settings. They are per process and per Spark.
FilesCode, data, checkpointsDecide how both Sparks get the same code and data, and where checkpoints go so both can read them when resuming.

Automatic or not

What torchrun and DDP split automatically, and what your code must do.

No CPU load moves from one Spark to the other. You start torchrun on each Spark. Each starts processes on its own machine, and each process, its CPU threads and its DataLoader workers use that Spark's processor. PyTorch shares data between the processes only where the program uses its distributed functions, directly or through something like DDP.

DistributedSamplereach process takes its own sample numbersmy-spark: DataLoader workersits own CPU cores, first shareTraining process and its threadsthe same CPU coresOne GPUone full model copy with DDPspark-two: DataLoader workersits own CPU cores, second shareTraining process and its threadsthe same CPU coresOne GPUone full model copy with DDPgradients cross the cable; CPU work does not
Where CPU work runs in a two-Spark DDP job that uses DistributedSampler. Our own drawing.
JobDone for youWhat your code or you must do
Starting processestorchrun starts and watches the workers on the machine where you run itStart it on both Sparks, with the same job name and meeting point
RanksWith c10d, torchrun sets RANK, LOCAL_RANK and WORLD_SIZERead them. Do not tie a Spark to a rank: PyTorch warns that ranks can change after a restart or membership change
Choosing the GPUNothing by itselfUse LOCAL_RANK as the GPU number, and wrap your model in DDP with it
Dividing the datasetDDP does not divide your input. DistributedSampler divides the sample numbers when you use itGive it to the DataLoader as sampler, without shuffle=True. Call set_epoch at the start of each epoch, before looping over the loader, or the shuffled order repeats
Batch sizeEach process loads its own batchesbatch_size is per process: with two processes, one step covers twice that many samples. Check your learning rate and loss: PyTorch notes that the scale of gradients depends on whether your loss averages or sums
GradientsDDP all-reduces them during the backward passBuild the same model on both before wrapping it, and do not change its parameters afterwards
Uneven dataNot by defaultGive both the same number of batches, or use DDP’s join context manager
Preparing data on the CPUDataLoader workers on the same Spark, if you set num_workersChoose the number. One-off work such as tokenising a dataset is not shared between machines unless your code does it
Model memoryWith DDP, no: a full copy eachUse FSDP or another sharding method if one copy does not fit
Code, datasets, cachesNot copied by these commandsPut the same versions on both Sparks, at paths your script can open
CheckpointsNothing is saved unless your code saves itWith DDP, write from one process. That file lands on that process’s Spark, so make it readable on both before you resume

The sampler gives each process every second index. With its default drop_last=False it repeats a few samples when the dataset does not divide evenly; with True it leaves the tail out.

What a minimal DDP training script contains.

This shows the shape, in our own words. It is not a complete script: you write build_dataset, build_model and train_step, and replace the capitals. It does not load a checkpoint, so add that before you rely on restarts. We have not run it.

import os
import torch
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as DDP
from torch.utils.data import DataLoader
from torch.utils.data.distributed import DistributedSampler


def main():
    local_rank = int(os.environ["LOCAL_RANK"])
    torch.cuda.set_device(local_rank)
    dist.init_process_group(backend="nccl")

    dataset = build_dataset()
    sampler = DistributedSampler(dataset)
    loader = DataLoader(dataset, batch_size=BATCH_PER_PROCESS,
                        sampler=sampler, num_workers=NUM_WORKERS)
    model = DDP(build_model().to(local_rank), device_ids=[local_rank])
    optimizer = torch.optim.AdamW(model.parameters())

    for epoch in range(EPOCHS):
        sampler.set_epoch(epoch)
        for batch in loader:
            train_step(model, optimizer, batch, local_rank)
        if dist.get_rank() == 0:
            torch.save(model.module.state_dict(), "checkpoint.pt")

    dist.destroy_process_group()


if __name__ == "__main__":
    main()

This example overwrites checkpoint.pt after every epoch. Use a new folder, or your own file names, so you do not replace a checkpoint you need. A real resume also needs the optimizer state and your position in training.

When loading, PyTorch’s DDP tutorial passes a map_location so each process loads onto its own device. A training library such as Accelerate may do several of these jobs for you; read its documentation to see which.

From the DDP reference, the data loading reference, the multi-GPU tutorial, the DDP tutorial and the multi-node tutorial.

CPU settings

How to set CPU threads and DataLoader workers on each DGX Spark.

NVIDIA lists a 20-core Arm processor in DGX Spark, and 128 GB of memory shared by the processor and the GPU. Memory that data loading uses comes out of the same pool as the model’s.

SettingWhat it controlsDefaultWhen to change it
OMP_NUM_THREADSOpenMP threads in each processtorchrun’s source: if you have not set it and --nproc-per-node is above 1, torchrun sets it to 1 and prints a warning. With 1, as here, torchrun leaves it as it was.When timings or CPU use show too many or too few threads. Set it the same way on both Sparks and measure
torch.set_num_threads(n)Threads PyTorch uses inside one CPU operation, in that processChosen by PyTorch; print torch.get_num_threads() to see itCall it near the start, before PyTorch has run any work
num_workersSeparate processes that load data, for each DataLoader in each training process0: the training process loads the data itselfWhen the GPU waits for data. Raise it in steps and measure. Each worker uses CPU and memory
prefetch_factorBatches each worker loads aheadNone with no workers; 2 with workersLower it if waiting batches use too much memory; raise it only if measurement shows a gain
persistent_workersWhether workers stay alive after one pass through the dataFalseIf starting workers again each epoch costs time. They keep their memory
pin_memoryWhether the loader puts batches in page-locked memory before returning themFalseMeasure with and without. Memory on DGX Spark is shared, and we have not measured this there
--ipc=host or --shm-sizeShared memory the container has for passing data between processesDocker’s own shared memory is too small for multi-worker loading, PyTorch saysKeep one of the two. This page uses --ipc=host

The When to change it column is our advice, not PyTorch’s.

PyTorch’s rule against too many threads: with N processors and M processes on one machine, PyTorch says that each should use at most N divided by M threads, rounded down. Apply it to each Spark on its own; the two processors are not added together.

Our advice: count your DataLoader workers as users of those processors too, and leave room for the system and anything else running. We give no thread or worker number: it depends on your data and your script.

Inside each DataLoader worker, PyTorch sets its own thread count to 1. That line is about PyTorch’s own threads; we have not checked what other libraries in your data code do. Workers get different PyTorch seeds, but other libraries’ random numbers may need seeding in worker_init_fn. PyTorch also warns that workers can come to use as much CPU memory as the parent process, for example when the dataset holds many Python objects.

To see what a container starts with, run this inside it on both Sparks:

python3 -c 'import os, torch; print(os.cpu_count(), torch.get_num_threads(), os.environ.get("OMP_NUM_THREADS"))'

To set the thread count for one run, type your number in place of the capitals, in front of the same torchrun command, on both:

OMP_NUM_THREADS=YOUR-THREADS torchrun --nnodes=2 --nproc-per-node=1 \
  --rdzv-id=spark-train --rdzv-backend=c10d \
  --rdzv-endpoint="$HEAD_IP:29400" \
  YOUR-SCRIPT.py

Every setting

torchrun settings for two nodes, with their defaults.

Defaults are from the PyTorch 2.15.0 torchrun source unless another page is named. --standalone is for jobs on a single machine; do not use it here.

SettingDefaultWhat it controls and when to change it
--nnodes1:1Number of machines, or a minimum and maximum. Set 2
--nproc-per-node1Processes on this machine; also takes gpu, cpu, xpu or auto. cpu starts one per counted processor, which is not what a one-GPU training job wants
--rdzv-backendstaticHow the machines find each other. This page sets c10d
--rdzv-endpointemptyThe meeting point as host and port. With c10d, the torchrun page uses 29400 if you give no port
--rdzv-idnoneThe job’s name. The same on both; give each job its own
--rdzv-conf join_timeout600 secondsRendezvous page: time allowed for the meeting to complete. Raise it if the second Spark cannot be started in time
--max-restarts0Times the worker group may be restarted before the job fails
--monitor-interval0.1 secondsHow often torchrun looks at the workers’ state. We know no reason to change it here
--node-rank0Only for static rendezvous
--master-addr, --master-portThis machine; 29500Only for static rendezvous
--log-dir, --redirects, --teeNo folder; no redirect; no copySave worker output to files, or to files and the screen. --tee 3 copies both normal and error output. Logs stay on each Spark
init_process_group timeout10 minutes with NCCL, 30 with other backendsDistributed page. A long step by one process while the other waits can hit it. Find the cause before raising it
NCCL_SOCKET_IFNAME, GLOO_SOCKET_IFNAMEFound automaticallyWhich network interface to use. Set them to the cluster interface, so you know which one is meant
NCCL_DEBUGNot set by this pageINFO prints how NCCL started, for troubleshooting

torchrun also passes each worker LOCAL_WORLD_SIZE, GROUP_RANK, MASTER_ADDR, MASTER_PORT and TORCHELASTIC_RESTART_COUNT, among others.

Set up

How to set up torchrun on two nodes.

  1. Save a tiny check program on both.

    In an empty folder on each Spark, save this as check_link.py. Each process starts with the number 1; adding them across the two should give 2.

    import os
    import socket
    import torch
    import torch.distributed as dist
    
    local_rank = int(os.environ["LOCAL_RANK"])
    torch.cuda.set_device(local_rank)
    dist.init_process_group(backend="nccl")
    
    value = torch.ones(1, device="cuda")
    dist.all_reduce(value)
    print(f"{socket.gethostname()} rank {dist.get_rank()} of "
          f"{dist.get_world_size()}: sum = {value.item()}")
    
    dist.destroy_process_group()
  2. Open the container on both.

    From that folder. ETH_IF is the cluster interface that is up. HEAD_IP is the first Spark's link address, on both.

    export HEAD_IP="FIRST-SPARK-LINK-ADDRESS"
    export ETH_IF="enp1s0f1np1"
    export PT_IMAGE="nvcr.io/nvidia/pytorch:TAG-FROM-NVIDIA-PLAYBOOK"
    
    docker run --rm -it --name pt-cluster \
      --gpus all --network host --ipc host --ulimit memlock=-1 \
      --device /dev/infiniband \
      -e HEAD_IP \
      -e NCCL_SOCKET_IFNAME="$ETH_IF" -e GLOO_SOCKET_IFNAME="$ETH_IF" \
      -v "$PWD:/work" -w /work "$PT_IMAGE"

    --device /dev/infiniband passes in the fast link's devices. Without them NCCL falls back to ordinary networking, which is much slower.

    Host networking lets the container use the Spark's networks directly, and the folder you mount can be changed from inside it. Mount only your work folder, and use images and code you trust.

  3. Run the same command on both.

    Start it on the first Spark, then promptly on the second. Both use identical arguments.

    torchrun --nnodes=2 --nproc-per-node=1 \
      --rdzv-id=spark-check --rdzv-backend=c10d \
      --rdzv-endpoint="$HEAD_IP:29400" \
      check_link.py

    The torchrun page explains these: --nnodes is the number of machines, --nproc-per-node the processes on each, and the rendezvous options say where they meet. Do not give the two Sparks fixed rank numbers in your code; torchrun hands them out.

Check

How to tell the two-node run worked.

What you seeMeaning
Each terminal prints its host name, a rank of 2, and sum = 2.0Both processes joined and exchanged data.
Set NCCL_DEBUG=INFO before the commandThe log shows which interfaces and transport NCCL chose. Check they are the cluster ones.
It stops at start-upOne side never arrived. Check the address, the port, the job name and the ping between the Sparks.

While your real script runs, watch each Spark from a second terminal: nvidia-smi shows the GPU, and top shows processor and memory use (press 1 to see each processor). Our advice: if the GPU often waits while data workers are busy, look at data loading; if many threads compete and throughput falls, try fewer. Change one setting at a time, and compare the same number of steps.

Then try your real script with a very small dataset and few steps. Save checkpoints, and test that you can resume from one, before a long run. Load only checkpoints your own jobs wrote: PyTorch warns that loading a distributed checkpoint can run code.

NVIDIA's playbooks

NVIDIA's two-Spark fine-tuning playbooks.

NVIDIA's current fine-tuning playbook uses Docker Swarm and Accelerate for two nodes. It changes the Docker settings on both Sparks and restarts Docker, which stops running containers.

Read any start script before you run it. On 26 November, the container start script in NVIDIA's earlier PyTorch fine-tuning playbook turned on SSH sign-in for the root user with a fixed, well-known password, and turned off host-key checks, in a container using the Spark's own network. Do not run it like that on any network others can reach. The commands on this page need no SSH server in the container.

Check the current files yourself; they may have changed since.

Stop and undo

How to stop a torchrun job, and clean up.

Stopping a job loses work since its last checkpoint.

To stop: press Ctrl+C on both Sparks, then check that neither still shows the process in nvidia-smi. Leave each container with exit; --rm removes it. From another terminal:

docker stop pt-cluster

To undo: delete check_link.py and, if you want the disk space, the image with docker rmi. These steps changed no system settings. If you followed the Swarm playbook, use its own clean-up steps.

Problems

If torchrun hangs or one node fails.

If a worker fails, torchrun stops the local group and, with --max-restarts set, can start it again. If a whole node's launcher is lost, PyTorch says it is up to whatever manages the job to stop or replace it. Do not assume a long run recovers by itself.

What you seeWhat to try
Connection refused or time-out at the meeting pointStart the first Spark first; check the link address and that nothing else uses the port.
NCCL errors after joiningRun NVIDIA's NCCL test, and check the interface setting on both.
Both Sparks seem to train on the same samples, or every epoch has the same orderCheck that the DataLoader uses DistributedSampler and that set_epoch is called each epoch.
A DataLoader worker is killed, or reports a shared memory errorKeep --ipc=host or give a larger --shm-size, check free memory, and try fewer workers.
Training stalls near the end of an epochOne process may have run out of batches first. Make the counts equal, or use join.
Out of memorySplitting depends on how your script shares the model. Lower the batch size or sequence length.

More: cluster problems by symptom.

Next

Keep going.

About Server AI Hub

Server AI Hub is our app for looking after a DGX Spark. You do not need it to follow this playbook. It is coming soon to the App Store and the Microsoft Store.

See what Server AI Hub does

Sources

Check the makers’ own pages.

Read on 26 and 27 November 2026. These projects change often; if their pages differ from this one, follow them.

General guidance only, in our own words. Back up before you start; you use these steps at your own risk. NVIDIA, DGX, DGX Spark, ConnectX and CUDA are trademarks of NVIDIA Corporation; Kubernetes, K3s, Ray, PyTorch, vLLM, SGLang, NGINX, Docker and other names belong to their owners. 6ixLabs is not affiliated with or endorsed by NVIDIA or any of these projects.