# KAI Scheduler

> A Kubernetes scheduler that allocates GPUs to AI workloads with fair-share and topology-aware policies

- Category: Models & Inference / GPU & Compute Clouds
- Language: Go
- Licence: Apache-2.0
- Repository: https://github.com/kai-scheduler/KAI-Scheduler
- Canonical page: https://ai-tldr.dev/tools/kai-scheduler/

## In short

KAI Scheduler is a Kubernetes scheduler, originally from NVIDIA, that manages how GPU resources are allocated to AI and machine learning workloads. It runs as an add-on scheduler in your cluster, so you opt workloads into it per pod rather than replacing the default kube-scheduler. It sits in the GPU & Compute Clouds category of the Models & Inference tools and is open-source, written in Go and licensed Apache-2.0.

## Overview

KAI Scheduler is a Kubernetes scheduler, originally from NVIDIA, that manages how GPU resources are allocated to AI and machine learning workloads. It runs as an add-on scheduler in your cluster, so you opt workloads into it per pod rather than replacing the default kube-scheduler.

It is built for clusters that mix many kinds of jobs at once: small interactive notebooks, large distributed training runs, and inference services, all competing for the same GPUs. It splits resources across queues and applies fairness rules so no single team starves the others, while still keeping the hardware busy.

As a compute orchestration tool, it sits between your workloads and the cluster's nodes. Platform teams use it to set quotas, priorities, and placement rules; developers just add a queue label and a scheduler name to their pods and let KAI decide where the work lands.

## What it does

- Gang (batch) scheduling: all pods in a group are placed together or not at all, which matters for distributed training
- Fairness policies based on Dominant Resource Fairness (DRF), plus time-based fairshare that accounts for historical usage
- Hierarchical queues with per-queue quotas, over-quota weights, limits, and priorities
- Topology-Aware Scheduling (TAS) to place tightly coupled pods close together on the network
- Bin-packing or spread placement, workload consolidation, and elastic scaling between min and max pod counts
- Dynamic Resource Allocation (DRA) support for vendor GPUs via Kubernetes ResourceClaims; runs alongside other schedulers

## Getting started

KAI Scheduler installs into a Kubernetes cluster with Helm. You need a running cluster, the Helm CLI, and the NVIDIA GPU-Operator if you plan to schedule GPU workloads.

1. Install with Helm

   Install the scheduler from the published OCI chart into its own namespace. Replace <VERSION> with a release from the project's releases page.

```bash
helm upgrade -i kai-scheduler oci://ghcr.io/kai-scheduler/kai-scheduler/kai-scheduler -n kai-scheduler --create-namespace --version <VERSION>
```

2. Submit a pod to the scheduler

   To route a pod through KAI, set schedulerName to kai-scheduler and add the kai.scheduler/queue label. Default queues are created on install. Submit workloads from a dedicated namespace, not the kai-scheduler namespace.

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: cpu-only-pod
  labels:
    kai.scheduler/queue: default-queue
spec:
  schedulerName: kai-scheduler
  containers:
    - name: main
      image: ubuntu
      args: ["sleep", "infinity"]
      resources:
        requests:
          cpu: 100m
          memory: 250M
```

3. Apply the pod

   Apply the manifest with kubectl and KAI will place it according to your queue and fairness policies.

```bash
kubectl apply -f cpu-only-pod.yaml
```

## When to use it

- Sharing a fleet of GPU nodes across several teams while enforcing per-team quotas and fair-share so no group monopolizes the cluster
- Running distributed training jobs that need all their workers scheduled at once (gang scheduling) instead of partially placed
- Mixing interactive notebooks, batch training, and inference on one cluster with priorities and preemption between them
- Placing tightly coupled multi-GPU or multi-node workloads with topology awareness to keep network hops low
