Curriculum / Part 7 · Kubernetes, schedulers and data locality
Lesson 32

Schedulers and data

How schedulers and data meet: Slurm and Kubernetes placement, burst buffers, staging in job steps, and data-aware scheduling.

⏱ 30 min5-question quiz

The simple version

A coach books the gym (GPUs) but forgets to bring the balls (data) until the team is already on court. Good schedulers make sure the balls arrive before, or right as, the team walks in.

Slurm

Slurm allocates nodes to jobs; storage is mostly the job's problem unless you make it the scheduler's. Common patterns:

  • Stage data in a prolog or first job step (copy to node-local NVMe), then train.
  • sbcast copies a file to every allocated node's local storage.
  • Burst buffer plugins let a job request fast staging space and stage data in and out around the job.
  • --constraint features (node labels) steer jobs to nodes with the right local storage or network.

Kubernetes

In Kubernetes, data placement comes through volumes (Lesson 31), node affinity and labels, and topology-aware provisioning (WaitForFirstConsumer). Init containers can stage data before the main container starts. Batch frameworks add gang scheduling and queueing so a multi-node job starts all at once.

Data-aware placement

If a node already holds a warm cache of the dataset (Lesson 33), placing the next job there skips the copy. Few schedulers do this automatically; teams often encode it with labels ("dataset-x-cached") and affinity. The trade-off: waiting for a warm node vs starting now on a cold one and paying the staging time.

Tools

sbatch --constraint=FEATURE
Steer Slurm jobs to labelled nodes.
sbcast FILE DEST
Copy a file to all nodes in a Slurm allocation.
kubectl label node / nodeAffinity
Mark and target nodes with warm caches.

Quiz

Lab

Related lab

Lab 7.2 · Cold cache on a new node

The same training job runs on gpu-a with GPUs 100% busy, but on the newly added gpu-f they sit idle more than half the time. On each node the job reads /scratch/cache/video-shards if it exists, otherwise /nas/datasets/video-shards.

Start lab 7.2 →

Try it now in the simulator (opens with the command ready; press Enter):

$ hosts$ ls -lh /scratch/cache