⚙️
Domain 3 · AI Operations · 22% of the exam

Slurm: the HPC workload manager

How Slurm allocates nodes, queues jobs and launches parallel work, with the daemons, entities and commands the exam expects.

Lesson 27 of 29~13 min read4 quiz questions5 key terms
Exam objectives this lesson covers
  • Describe AI cluster orchestration and job scheduling essentials.

Slurm is an open-source, fault-tolerant and highly scalable cluster manager and job scheduler for Linux, used on most of the world’s supercomputers and on many DGX clusters. It needs no kernel changes. SchedMD lists its three key functions:

  1. Allocate exclusive or shared access to compute nodes for a period of time.
  2. Provide a framework to start, execute and monitor parallel work (such as a multi-node training job) on those nodes.
  3. Arbitrate contention by managing a queue of pending work.
Userssbatch · srun · squeueslurmctldcontroller (+ backup)slurmdbdaccounting databaseslurmdnode 1 · 8 GPUs (GRES)slurmdnode 2 · 8 GPUs (GRES)slurmdnode 3 · 8 GPUs (GRES)slurmdnode 4 · 8 GPUs (GRES)slurmdnode 5 · 8 GPUs (GRES)Partition "train": nodes 1-3Partition "debug": nodes 4-5
Fig 1. Slurm architecture. Users talk to the central controller; slurmd on every node runs the work; slurmdbd records accounting; partitions group nodes into queues.

01The daemons

DaemonRuns onJob
slurmctldManagement node (optional backup)The brain: tracks resources and jobs, schedules
slurmdEvery compute nodeWaits for work, runs it, reports status
slurmdbdDatabase node (optional)Accounting for one or more clusters in one database
slurmrestdOptionalREST API for Slurm

02The entities

03Commands

CommandUse
sbatchSubmit a batch script to the queue
srunLaunch a job or a job step (parallel tasks)
squeueSee pending and running jobs
sinfoSee partitions and node states
scancelCancel a job
sacctAccounting for running and completed jobs
scontrolAdmin: view and change configuration and state (e.g. drain a node)
sacctmgrAdmin: manage accounts, users and limits
#!/bin/bash
#SBATCH --job-name=llm-train
#SBATCH --partition=train
#SBATCH --nodes=4                 # 4 DGX nodes
#SBATCH --gres=gpu:8              # 8 GPUs per node via GRES
#SBATCH --ntasks-per-node=8       # one task per GPU
#SBATCH --time=48:00:00
srun python train.py --config llama.yaml
sbatch train.sh        # → Submitted batch job 4182
squeue -u $USER        # is it pending or running?
sinfo -p train         # how many nodes are idle?
scancel 4182

04Plugins that matter for AI

Slurm is built from plugins: scheduling (including backfill), priority (multifactor: age, fair share, size, QoS), preemption, gang scheduling, topology-aware placement (keep a job under the same switches), GRES for GPUs, MPI and container support. On NVIDIA clusters Slurm works with DCGM to avoid unhealthy GPUs, and jobs use NCCL and GPUDirect RDMA across nodes. Base Command Manager can install and manage Slurm for you.

An air traffic controller. Planes (jobs) ask for runways (GPU nodes); the controller queues them by priority, assigns runways, and keeps every runway busy. A plane that needs four runways at once only takes off when all four are free.

✦Key terms: flip the cards

What the exam looks for
  • Daemons: slurmctld (brain), slurmd (nodes), slurmdbd (accounting).
  • Partitions are queues; GPUs requested with GRES.
  • Commands: sbatch, srun, squeue, sinfo, scancel, sacct, scontrol.
Common traps
  • sbatch submits a script; srun launches tasks (often inside the script).
  • slurmdbd is accounting, not the scheduler.

?Quick quiz

1. Which daemon is the central Slurm scheduler?

Why: slurmctld is the controller.

2. How do you request 8 GPUs per node in a Slurm script?

Why: GPUs are generic resources (GRES).

3. What is a Slurm partition?

Why: Partitions group nodes and set queue limits.

4. Which command shows the state of nodes and partitions?

Why: sinfo reports partitions and node states.

Score: 0 / 4

Original readingSlurm Workload Manager: Overview, SchedMD ↗

This lesson explains the reading in plain language and adds the exam context around it. Read the original too: it is short, and seeing the vendor wording helps on exam day.

All lessons →
↑