Inferensys

Glossary

Slurm

An open-source, highly scalable workload manager and job scheduler for Linux clusters, widely used in HPC and AI supercomputing environments to allocate and manage access to GPU resources.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
WORKLOAD MANAGEMENT

What is Slurm?

Slurm is an open-source, fault-tolerant, and highly scalable workload manager and job scheduler for Linux clusters, designed to allocate exclusive or non-exclusive access to compute resources, particularly GPUs, for executing large-scale AI and HPC tasks.

Slurm (Simple Linux Utility for Resource Management) provides the scheduling backbone for many of the world's most powerful supercomputers and on-premises GPU clusters. It arbitrates access to parallel hardware by queuing user-submitted batch jobs and interactive sessions, enforcing resource allocation policies through a centralized controller daemon (slurmctld) that communicates with node-level daemons (slurmd).

In AI infrastructure, Slurm is critical for managing multi-node GPU training runs, often integrating with NCCL for optimized inter-process communication and PyTorch or TensorFlow distributed launchers. Its plugin architecture allows administrators to define complex scheduling priorities, enforce NUMA alignment, and manage heterogeneous hardware topologies, ensuring maximum utilization of expensive accelerator resources.

WORKLOAD MANAGEMENT

Core Capabilities of Slurm

Slurm is the de facto open-source scheduler for HPC and AI supercomputing. It allocates exclusive or shared access to GPU nodes, orchestrates complex job dependencies, and enforces fair-share policies across multi-tenant clusters.

01

GPU Generic Resource Scheduling

Slurm treats GPUs as consumable Generic Resources (GRES) , enabling fine-grained allocation. The gres.conf file defines GPU topology, including NVLink connectivity and MIG partitions. Users request resources with --gres=gpu:A100:4, ensuring exclusive access. The scheduler tracks GPU-to-CPU affinity and NUMA locality, preventing cross-socket memory access penalties. MIG support allows fractional GPU allocation, where a single A100 can be partitioned into up to seven isolated instances, each scheduled independently.

MIG 7x
Max Partitions per A100
02

Multi-Factor Priority & Fair-Share

The multifactor priority plugin calculates job priority using a weighted formula combining fair-share, job age, partition priority, and QoS. Fair-share is computed via a decaying half-life algorithm that normalizes usage over time. The sshare command exposes raw usage data. QoS-based limits enforce per-user, per-account, and per-partition caps on running jobs, CPUs, and GRES. Preemption mechanisms allow high-priority jobs to suspend or requeue lower-priority work, ensuring critical workloads meet deadlines.

03

Job Arrays & Dependency Chains

Slurm supports job arrays for embarrassingly parallel workloads like hyperparameter sweeps. A single sbatch --array=1-1000 command submits thousands of nearly identical jobs with indexed input. Job dependencies chain tasks using --dependency=afterok:<job_id>, creating directed acyclic graphs. Supported dependency types include after, afternotok, afterany, and singleton. This enables complex multi-stage pipelines where inference jobs launch only after training converges, all managed without external orchestration.

04

Backfill Scheduling & Topology Awareness

The backfill scheduler reserves resources for high-priority jobs while allowing smaller, shorter jobs to run on idle resources without delaying the reserved job. This dramatically increases cluster utilization. Topology-aware scheduling optimizes job placement using the topology/tree plugin, which models switch hierarchies and minimizes inter-node communication latency. Combined with --switches and --contiguous flags, Slurm ensures tightly coupled MPI and NCCL workloads land on physically adjacent nodes, maximizing NVLink and InfiniBand bandwidth.

05

REST API & Federated Clusters

The Slurm REST API (slurmrestd) exposes full scheduler functionality via OpenAPI-compliant endpoints, enabling programmatic job submission, monitoring, and cluster management from external platforms. Federation (slurmdbd with multiple clusters) allows a single accounting database to manage geographically distributed clusters. Jobs can be submitted to specific clusters or left for the federation to route based on availability. This architecture supports hybrid on-premises deployments where multiple GPU clusters share a unified user namespace and accounting ledger.

06

Accounting, Profiling & Enforcement

The Slurm Accounting Database (slurmdbd) stores historical job records, usage statistics, and QoS definitions in MySQL. The sacct command retrieves detailed job metrics including GPU utilization, memory efficiency, and I/O patterns. cgroup-based resource enforcement prevents jobs from exceeding requested CPU, memory, and GPU limits. The X11 forwarding and --pty options support interactive sessions for debugging. Combined with DCGM integration, Slurm can automatically terminate jobs that underutilize allocated GPUs, reclaiming resources for other users.

SLURM WORKLOAD MANAGER

Frequently Asked Questions

Clear answers to common questions about Slurm, the open-source job scheduler that powers the world's largest GPU clusters and supercomputers.

Slurm (Simple Linux Utility for Resource Management) is an open-source, highly scalable workload manager and job scheduler for Linux clusters. It operates by maintaining a central controller daemon (slurmctld) that tracks the state of all compute nodes reported by slurmd daemons running on each node. When a user submits a job via sbatch or srun, the controller evaluates the job's resource requirements—such as GPU count, memory, and wall time—against available resources and enqueues it. A scheduling algorithm, typically backfill scheduling with multifactor priority, then determines the optimal order to dispatch jobs, maximizing cluster utilization while ensuring fairness. Slurm allocates exclusive or shared access to nodes, launches the job, and monitors its lifecycle, handling preemption, requeueing, and accounting through a database (slurmdbd). It is the de facto scheduler for the majority of the TOP500 supercomputers, including GPU clusters running large-scale AI training workloads.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.