Running a GPU cluster without a job scheduler is like operating a data center without a cooling system — technically possible, but wasteful and unsustainable. As GPU colocation deployments scale from a handful of GPUs to hundreds or thousands, workload orchestration becomes the critical layer that determines whether your hardware investment delivers full value or sits idle between manually launched jobs.
Slurm (Simple Linux Utility for Resource Management) has emerged as the dominant scheduler for GPU-intensive compute, powering over 60% of the world's TOP500 supercomputers and the majority of enterprise AI training clusters. This guide covers how Slurm manages GPU resources, best practices for configuration, and how it compares to alternatives like Kubernetes and PBS.
What Is Slurm and Why GPU Clusters Need It
Slurm is an open-source, highly scalable workload manager originally developed at Lawrence Livermore National Laboratory. It handles three core functions that are essential for GPU cluster operations:
- Resource allocation — assigns GPU, CPU, memory, and network resources to jobs based on availability and policy
- Job queuing and scheduling — maintains priority queues with fair-share algorithms so multiple users and projects share infrastructure efficiently
- Job execution and monitoring — launches, tracks, and manages distributed processes across multiple nodes
Without a scheduler, GPU clusters face several operational problems: users manually SSH into nodes and launch jobs that conflict with other workloads, GPUs sit idle between training runs with no automated backfill, there is no accounting for resource usage across teams, and multi-node distributed training requires manual coordination of IP addresses, ports, and process ranks.
How Slurm Handles GPU Resources: The GRES System
Slurm manages GPUs through its Generic Resource (GRES) plugin, which treats GPUs as schedulable resources alongside CPUs and memory. The GRES configuration defines what GPU hardware exists on each node and lets users request specific GPU types and counts in their job submissions.
Key GRES Configuration Concepts
| Component | Purpose | Example |
|---|---|---|
| gres.conf | Defines GPU hardware per node | NodeName=gpu-node01 Name=gpu Type=a100 File=/dev/nvidia[0-7] Count=8 |
| GresTypes | Declares resource types in slurm.conf | GresTypes=gpu |
| Job request | User specifies GPU needs | --gres=gpu:a100:4 (4 A100 GPUs) |
| GPU binding | Pins processes to specific GPUs | --gpu-bind=closest (NUMA-aware) |
The GRES system supports GPU type filtering, so clusters with mixed hardware — for example, NVIDIA H100 and A100 GPUs in different node pools — can route jobs to the appropriate accelerator based on workload requirements.
Multi-Node Distributed Training with Slurm
Large language model training and other distributed AI workloads require coordinating GPU processes across multiple servers connected by high-speed InfiniBand networking. Slurm provides the orchestration layer that makes this practical at scale.
How Slurm Coordinates Distributed Training
When a user submits a multi-node job, Slurm performs several coordination steps automatically:
- Node selection — identifies nodes with the requested GPU count and type, preferring topologically close nodes for lower communication latency
- Environment setup — sets variables like
SLURM_PROCID,SLURM_NODELIST,SLURM_NTASKS, andMASTER_ADDRthat distributed training frameworks (PyTorch DDP, DeepSpeed, Megatron-LM) read automatically - Process launch — uses
srunto start the correct number of processes on each node, binding them to their assigned GPUs - Network coordination — ensures InfiniBand or RoCE interfaces are available and NCCL collective operations have dedicated bandwidth
This automation is critical for clusters with shared parallel storage, where checkpoint writes from hundreds of GPUs must be coordinated to avoid I/O storms that slow training.
Scheduling Policies and Queue Management
Effective GPU scheduling requires more than first-come-first-served queuing. Slurm offers several scheduling algorithms that maximize GPU utilization.
Fair-Share Scheduling
Fair-share tracks historical resource usage per user or project account and adjusts job priority so that teams who have used fewer resources recently get higher priority. This prevents any single team from monopolizing an expensive GPU cluster while ensuring no GPUs sit idle if work is waiting.
Backfill Scheduling
Backfill is perhaps Slurm's most valuable feature for GPU clusters. When a large multi-node job is waiting for resources, Slurm examines the queue and finds smaller jobs that can complete before those resources are needed. On a well-configured cluster, backfill can increase GPU utilization from 60-70% to 85-95%.
Preemption
For clusters serving both production inference and research training, Slurm supports job preemption. High-priority inference jobs can preempt lower-priority training jobs, which checkpoint their state and resume later. This is essential for managed AI hosting environments where SLAs require guaranteed inference capacity.
Scheduling Policy Comparison
| Policy | Best For | GPU Utilization Impact |
|---|---|---|
| FIFO (first-in-first-out) | Single-user clusters | 50-65% (large jobs block small ones) |
| Fair-share | Multi-team environments | 70-80% (balanced access) |
| Backfill + fair-share | Mixed workload clusters | 85-95% (fills gaps automatically) |
| Preemptive + backfill | Production + research mix | 90-97% (SLA-guaranteed + opportunistic) |
Slurm vs. Kubernetes vs. PBS: Which Scheduler for GPU Workloads?
While Slurm dominates bare-metal GPU clusters, two other platforms compete in the orchestration space. The right choice depends on your workload profile and infrastructure model.
| Feature | Slurm | Kubernetes + GPU Plugin | PBS Pro / OpenPBS |
|---|---|---|---|
| Primary use case | Bare-metal HPC / AI training | Containerized inference / microservices | Traditional HPC / academic |
| GPU scheduling granularity | GRES with type filtering, GPU binding, MIG support | Device plugin, basic GPU count | Custom resource, GPU hooks |
| Multi-node training | Native (srun, MPI integration) | Requires MPI Operator or custom launcher | Supported (MPI integration) |
| Overhead | Minimal (no container layer) | Container runtime + orchestration | Minimal |
| Ecosystem | HPC tools, module system | Cloud-native, CI/CD pipelines | Traditional HPC |
| Scaling limit | 100,000+ nodes proven | 5,000-15,000 nodes practical | 50,000+ nodes |
Rax recommendation: For dedicated AI training clusters running on bare-metal GPU servers, Slurm delivers the lowest overhead and best multi-node training support. For mixed inference and API serving, Kubernetes with GPU device plugins provides better service orchestration. Many enterprise deployments use both — Slurm for training, Kubernetes for inference.
Best Practices for Slurm GPU Cluster Configuration
1. Enable NUMA-Aware GPU Binding
Modern GPU servers have non-uniform memory access (NUMA) topologies where each CPU socket controls specific PCIe lanes. Binding GPU processes to the correct NUMA node reduces memory access latency by 15-30%. Configure Slurm with --gpu-bind=closest or map GPUs to CPU cores in gres.conf to ensure processes use local memory controllers.
2. Configure GPU Accounting
Enable SlurmDBD (Slurm Database Daemon) with GPU-hours tracking. This provides per-user and per-project GPU consumption reports that are essential for chargeback in colocation environments, capacity planning, and identifying underutilized allocations. Integrate accounting data with your DCIM platform for unified infrastructure visibility.
3. Set Up Health Checks
Configure Slurm's HealthCheckProgram to run nvidia-smi diagnostics before each job starts. Failed GPU memory tests or thermal throttling should automatically drain the node from the pool, preventing jobs from launching on degraded hardware. This single configuration prevents the most common source of distributed training failures — one bad GPU in a multi-node job.
4. Implement Job Time Limits and Checkpointing
Set partition-level time limits (e.g., 72 hours for training, 1 hour for inference) and require jobs to checkpoint at regular intervals. This ensures that preempted or failed jobs lose minimal progress and that no single job monopolizes resources indefinitely. Modern training frameworks like DeepSpeed and FSDP support automatic checkpointing that integrates cleanly with Slurm's signal-based preemption.
5. Use Partitions for Workload Isolation
Create separate Slurm partitions for different workload types: a training partition with large time limits and multi-node access, an inference partition with strict SLAs and preemption rights, and a development partition with small GPU allocations and short time limits for debugging. This prevents experimentation jobs from blocking production workloads.
Slurm at Scale: Real-World Deployment Considerations
For clusters beyond 100 GPUs, several operational factors become critical:
- Controller redundancy — deploy slurmctld with a backup controller for high availability. A scheduler outage on a large cluster means no new jobs launch and running jobs lose management oversight.
- Database performance — SlurmDBD with MySQL/MariaDB handles accounting for clusters up to ~5,000 nodes. Beyond that, consider PostgreSQL or dedicated database servers with SSD storage.
- Network topology awareness — configure Slurm's topology plugin to understand your InfiniBand fabric (fat-tree, dragonfly) so multi-node jobs are allocated on nodes within the same switch or leaf for lowest latency.
- Power management — Slurm integrates with power management systems to cap cluster-wide power consumption, which is increasingly important as GPU density pushes rack power beyond 40kW.
Getting Started with Slurm for Your GPU Infrastructure
Deploying Slurm on a GPU cluster requires careful planning around hardware enumeration, network configuration, and storage integration. For organizations building or expanding GPU infrastructure in the UAE, Rax Data provides colocation environments with pre-configured networking and power infrastructure that simplify Slurm deployment at any scale.
Whether you are orchestrating a 16-GPU development cluster or a 1,000+ GPU training supercomputer, Slurm provides the scheduling intelligence that turns raw hardware into a productive, multi-tenant AI compute platform.
Need GPU Cluster Infrastructure?
Rax Data provides colocation and managed GPU hosting with InfiniBand networking, parallel storage, and redundant power — the physical foundation your Slurm cluster needs.
Get a Custom Quote