GPU scheduling

Also known as: GPU job scheduling

On this page 7

GPU scheduling, also called GPU job scheduling, is the process of deciding which workloads receive which graphics processing units, on which nodes and at what time. In AI infrastructure, a GPU scheduler turns a pool of expensive accelerators into a shared, policy-governed resource for model training, fine-tuning, batch inference and online serving.

Good scheduling matters because GPUs are the dominant cost of AI compute. A cluster that leaves accelerators idle, fragments them across nodes or places communication-heavy jobs on poorly connected hardware wastes money and slows research, even when every individual GPU is fast.

How a GPU scheduler places work

A GPU scheduler matches job requests to available devices in a repeated cycle. Each job declares how many GPUs it needs, often with constraints such as GPU model, memory size or interconnect. The scheduler maintains an inventory of free devices, applies queueing and priority policies, selects a placement and then binds the job to specific GPUs through the cluster manager.

Distributed training adds a decisive requirement: gang scheduling. A job that needs 64 GPUs must start on all 64 at once, because a partial allocation cannot make progress and only blocks capacity. Schedulers therefore reserve or wait for a complete set and avoid deadlocks between partially placed jobs.

The table below lists the main decisions a scheduler makes for each job.

DecisionQuestion answeredTypical inputs
AdmissionMay this job enter the queue nowTeam quota, budget, priority class
OrderingWhich waiting job runs nextPriority, fair share, wait time
PlacementWhich nodes and GPUs to useTopology, free memory, GPU type
SharingCan several jobs use one GPUMIG profiles, time slicing, MPS
PreemptionShould a running job be stoppedPriority gap, checkpoint support
Core scheduling decisions

Topology-aware placement

Topology-aware placement puts communicating GPUs as close together as possible. Inside a server, GPUs linked by NVLink or NVSwitch exchange data far faster than GPUs that talk through PCIe and host memory. Across servers, jobs benefit from staying within one network switch domain or one rack-scale system.

Placement quality directly affects collective communication such as all-reduce in data parallelism and the frequent exchanges in tensor parallelism. A scheduler that ignores topology can cut training throughput by a large margin, so experienced operators treat interconnect locality as a first-class constraint, not an optimization afterthought.

Topology awareness also reduces fragmentation. If small jobs scatter across many servers, no server keeps a complete set of eight free GPUs for a large tensor-parallel job. Bin-packing small jobs onto as few servers as possible preserves whole nodes for demanding workloads.

Placement levelInterconnectBest suited for
Same GPU partitionShared device memorySmall inference models
Same serverNVLink or NVSwitchTensor parallelism
Same rack or switchHigh-bandwidth fabricPipeline and data parallelism
Across racksMulti-tier networkData parallelism with tolerant overlap
Placement levels and their typical use

Sharing policies and GPU partitioning

Not every workload needs a full accelerator, so schedulers support fractional GPU allocation. The main techniques differ in how strongly they isolate tenants and how much overhead they add.

TechniqueIsolationTrade-off
Multi-Instance GPU (MIG)Hardware partitions of memory and computeFixed profiles, less flexibility
Time slicingNone for memory, turns at computeEasy setup, noisy neighbors
Multi-Process Service (MPS)Partial, shared contextGood throughput, weak fault isolation
Whole-GPU allocationFull device per jobSimple, often underused
Ways to share a single GPU

At the cluster level, fair-share scheduling balances usage among teams over time, while hierarchical quotas guarantee each group a minimum and allow borrowing of idle capacity. Borrowed capacity is usually preemptible, so jobs that use it should write regular checkpoints.

Common schedulers in AI infrastructure

Most AI teams build on either an HPC batch scheduler or Kubernetes extended for batch work. Slurm dominates traditional supercomputing and many research clusters, while Kubernetes is common where training and model serving share one platform. Add-ons such as Kueue and Volcano bring queueing and gang scheduling to Kubernetes, and commercial orchestration layers add fractional GPUs and quota dashboards.

  • Slurm: generic resource requests, partitions, fair-share and backfill, strong for large synchronous training.
  • Kubernetes with a device plugin: exposes GPUs as countable resources, strong for services and autoscaling.
  • Kueue and Volcano: job queues, gang admission and quota management on Kubernetes.
  • Ray: application-level scheduling of tasks and actors with fractional GPU requests.

The choice depends on the dominant workload mix. Long synchronous training favors batch semantics and backfill, whereas latency-sensitive inference favors autoscaling and service abstractions.

Pitfalls and how to avoid them

Most scheduling problems show up as low GPU utilization or long queue times rather than as obvious errors. The following table pairs frequent symptoms with their causes and remedies.

SymptomLikely causeRemedy
Large jobs wait for daysFragmentation across nodesBin packing and reservation windows
Training slower than expectedPoor topology placementTopology-aware constraints
Idle GPUs with full queueRigid quotas without borrowingHierarchical quotas with preemption
Lost work after preemptionNo checkpointingFrequent distributed checkpoints
Unstable inference latencyNoisy neighbors on shared GPUMIG or dedicated devices
Frequent problems in GPU clusters

A further mistake is measuring success only by allocation rate. A GPU that is allocated but waiting on data loading still produces nothing, so mature teams also track goodput and model FLOPs utilization alongside queue metrics.

Operators should also plan for hardware failures at scale. In clusters with thousands of GPUs, a node fault during a long training run is routine rather than exceptional. Schedulers that support automatic requeue and elastic restarts let a job resume from its last checkpoint on healthy nodes, while health checks that drain faulty servers before placement prevent repeated crashes on the same defective hardware.

Explained without jargon

Think of a busy restaurant with a limited number of tables. Some groups are large and must sit together. Others need only one seat. A good host decides who sits where and when. Nobody should wait while tables stand empty.

GPU scheduling does the same job for computer chips that train and run AI. It decides who gets which chips and when. Good scheduling keeps expensive hardware busy and work moving.

A typical use case

A research lab runs a cluster of 256 GPUs in 32 servers with eight GPUs each. Three teams share it: one trains a large language model on 128 GPUs, one runs dozens of small experiments, and one serves an internal chatbot that must answer within two seconds.

The platform team configures hierarchical quotas that guarantee each group a share and let idle capacity be borrowed. The large training job uses gang scheduling and is placed on 16 complete servers within one switch domain. Small experiments receive MIG slices, and the chatbot gets dedicated GPUs with a high priority class. Average utilization rises from about 45 percent to over 75 percent, and median queue time for experiments falls from hours to minutes.