KAI-Scheduler
AGENTS.md1.6k starsChanged 3 months agoApache-2.0View on GitHub
KAI Scheduler is a Kubernetes scheduler optimized for GPU resource allocation in AI/ML workloads, built on kube-batch with a modular plugin architecture. E2E tests run against a real Kubernetes using kind cluster and are located in test/e2e/suites/.
1 other project uses a version of this.
Trending
More talk lately.about the whole repository
Most recently taken up by
- NVIDIA/KAI-Schedulerword for word, first seen Oct 8, 2026
Who's talking about kai-scheduler/KAI-Scheduler
- ai-dynamo/grove“Move scheduler-specific schemes out of shared client scheme”GitHub · Jun 15, 2026 · 2 reactions
- ai-dynamo/grove“chore: upgrade Kubernetes deps and local images to 1.35 (incl. controller-runtime v0.23 and KAI-scheduler …”GitHub · May 12, 2026 · 1 reactions
- dsx-ai-factory/run-ai“[bug] status-updater: SumOwnedPodGroupResources counts 0 GPUs for podgroups that request nvidia.com/mig-*”GitHub · Nov 13, 2026
- taichi-dev/KAI-Scheduler“fix(scheduler): keep PodScheduled in cached pods (cherry-pick for v0.18.6-meshy.2)”GitHub · Nov 3, 2026
- JohnnyZPiggy/AccelSched-KAI“PoC-1B B1/B2: pinned native KAI shadow builder and registry probe”GitHub · Oct 27, 2026
The biggest 5 of 28 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 28
Talked about on GitHub (28 times).
On GitHub · 28
- Jun 15, 2026Move scheduler-specific schemes out of shared client scheme — ai-dynamo/grove2 reactions
- May 12, 2026chore: upgrade Kubernetes deps and local images to 1.35 (incl. controller-runtime v0.23 and KAI-scheduler v0.15) — ai-dynamo/grove1 reaction · 15 comments
- Nov 13, 2026[bug] status-updater: SumOwnedPodGroupResources counts 0 GPUs for podgroups that request nvidia.com/mig-* — dsx-ai-factory/run-ai0 reactions
- Nov 3, 2026fix(scheduler): keep PodScheduled in cached pods (cherry-pick for v0.18.6-meshy.2) — taichi-dev/KAI-Scheduler0 reactions
- Oct 27, 2026PoC-1B B1/B2: pinned native KAI shadow builder and registry probe — JohnnyZPiggy/AccelSched-KAI0 reactions
23 more on GitHub
- Oct 19, 2026KAI Scheduler Support — juno-fx/Terra-Official-Plugins0 reactions
- Oct 13, 2026feat(api): add core marker to SubGroup — kai-scheduler/api0 reactions
- Oct 12, 2026build(deps): bump KAI Scheduler to v0.18.5 — kai-scheduler/kai-resource-management0 reactions
- Oct 11, 2026build(deps): bump KAI Scheduler to v0.18.4 — kai-scheduler/kai-resource-management0 reactions
- Oct 11, 2026build(deps): bump KAI Scheduler to 0.0.0-173748a and its Go module to v0.18.5 — kai-scheduler/kai-resource-management0 reactions · 1 comment
- Oct 7, 2026feat: add NUMA memory group placement — kai-scheduler/api0 reactions · 1 comment
- Oct 6, 2026build(deps): bump KAI Scheduler to v0.18.3 — kai-scheduler/kai-resource-management0 reactions
- Oct 6, 2026build(deps): bump KAI Scheduler to 0.0.0-6a40ea3 and its Go module to v0.18.3 — kai-scheduler/kai-resource-management0 reactions · 1 comment
- Oct 5, 2026refactor(deps): consume API types from github.com/kai-scheduler/api — kai-scheduler/kai-resource-management0 reactions · 1 comment
- Oct 5, 2026refactor(deps): consume KAI types from github.com/kai-scheduler/api — kai-scheduler/kai-resource-management-api0 reactions
- Oct 1, 2026build(deps): bump KAI Scheduler to v0.18.2 — kai-scheduler/kai-resource-management0 reactions
- Oct 1, 2026build(deps): bump KAI Scheduler to 0.0.0-1db3d56 and its Go module to v0.18.2 — kai-scheduler/kai-resource-management0 reactions · 1 comment
- Sep 26, 2026fix(chart): create vgpu cache dirs 1777 in libsync — Project-HAMi/KAI-resource-isolator0 reactions · 2 comments
- Sep 8, 2026chore: dev-test kai-scheduler pkg at main HEAD, wire FIPSOnly through (not for merge) — dsx-ai-factory/run-ai0 reactions · 4 comments
- Sep 4, 2026feat: Add additional projects — aptakube/kubespec.dev0 reactions · 2 comments
- Sep 1, 2026fix(deploy): bump KAI Scheduler to v0.17.0 — ai-dynamo/dynamo0 reactions · 5 comments
- Aug 19, 2026build: source KAI Scheduler types from the scheduler repo — kai-scheduler/kai-resource-management-api0 reactions
- Aug 8, 2026fix(chart): make containers and vgpulock dirs writable by non-root workloads — Project-HAMi/KAI-resource-isolator0 reactions · 3 comments
- Jun 17, 2026Integration: KAI Scheduler — energy efficiency placement signal and queue chargeback — aitra-ai/aitra-meter0 reactions
- Jun 6, 2026[Add] KAI Scheduler (kai-scheduler/KAI-Scheduler) — PyTorchKR/landscape0 reactions
- Apr 23, 2026ACMM outreach: kai-scheduler/KAI-Scheduler — kubestellar/console0 reactions
- Mar 31, 2026[Content][2026-05-04] 大规模 GPU 调度:拓扑、队列、公平性的系统化实践 — pacoxu/AI-Infra0 reactions
- Mar 26, 2026[Feature] Support KAI Scheduler as a gang scheduling backend — sgl-project/rbg0 reactions
Other versions1 project uses a version of this.
Word for word · 1
- NVIDIA/KAI-Scheduler★ 1.6k100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- kai-pendingSkill
- snapshotsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 0 are common, 9 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Test files MUST ALWAYS be in the same directory as code
- Very specific: line 24
Test files names MUST ALWAYS end in _test.go.
- Distinctive: line 121
Follow the logging practices in CONTRIBUTING.md.
- Distinctive: line 127
DO NOT wrire obvious comments.
- Distinctive: line 128
Keep comments short, concise and to the point.
- Very specific: line 135
Use defer for cleanup and state restoration
- Very specific: line 142
Test files (*_test.go) have relaxed rules for goconst, errcheck, govet.
- Very specific: line 155
When opening a PR, use the template in .github/pull_request_template.md for the PR description
- Distinctive: line 177
Commit the fragment with your code.
- Distinctive: line 196
Use git mv when moving files to preserve history
- Distinctive: line 197
DO NOT add obvious comments that duplicate the code.
- Distinctive: line 198
Write comments ONLY when ABSOLUTELY necessary
- Distinctive: line 199
Keep Comments short, explicit and concise
- Very specific: line 200
DO NOT use I, we or any other pronoun
- Very specific: line 201
When performing a major change, run make validate after changes
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
KAI Scheduler - Agent Development Guide
KAI Scheduler is a Kubernetes scheduler optimized for GPU resource allocation in AI/ML workloads, built on kube-batch with a modular plugin architecture.
Build/Lint/Test Commands
Building
make build # Build all services (Docker-based)
make build-go SERVICE_NAME=scheduler # Build single serviceLinting
make lint # Run all linters (fmt, vet, golangci-lint)
make fmt-go # Format Go code
make vet-go # Run go vetTesting
unit and integration tests
- Test files MUST ALWAYS be in the same directory as code
- Test files names MUST ALWAYS end in
_test.go. Example:resolver_test.go
make test # Run all tests (unit + helm chart tests)
# Run a single test file
ginkgo -v ./pkg/scheduler/actions/allocate
# Run a specific test function
ginkgo -v --focus "TestHandleAllocation" ./pkg/scheduler/actions/allocate
# Run tests with Ginkgo (for integration tests)
ginkgo -v --focus "test name pattern" ./pkg/binder/controllers/integration_tests
# Run tests with envtest (requires setup-envtest)
make envtest
KUBEBUILDER_ASSETS="$(bin/setup-envtest use 1.34.0 -p path --bin-dir bin)" go test ./pkg/... -timeout 30mE2E tests
E2E tests run against a real Kubernetes using kind cluster and are located in test/e2e/suites/.
# Run locally with Kind (recommended for development)
./hack/run-e2e-kind.sh # Full e2e suite
./hack/run-e2e-kind.sh --preserve-cluster # Keep cluster after tests
./hack/run-e2e-kind.sh --local-images-build # Build images locally
# Run specific test suites (requires cluster with KAI installed)
ginkgo -r --randomize-all ./test/e2e/suites/allocate
ginkgo -r --randomize-all --focus "quota" ./test/e2e/suites
# Run with verbose output and trace
ginkgo -r --randomize-all --trace -vv ./test/e2e/suites/preemptCode Generation
make manifests # Generate RBAC
make generate-mocks # Generate mock implementations
make validate # Verify generated code is up to date. Also format and vet codebaseRepository Structure
Core Services (/cmd/ and /pkg/)
scheduler- Core GPU-aware batch scheduler with plugins, actions, and cachebinder- Pod binding execution with GPU sharing supportoperator- Lifecycle management of all KAI componentspodgrouper- PodGroup creation from workloads (Kubeflow, Spark, Ray, etc.)admission- Validating/mutating webhooks for KAI resourcesqueuecontroller- Queue resource management and status updatespodgroupcontroller- PodGroup lifecycle and status managementresourcereservation- GPU resource reservation for pending podsnodescaleadjuster- Node scaling integration for autoscalers
Supporting Packages (/pkg/)
common- Shared utilities (k8s utils, feature gates, flags)
API types
CRD types (Queue, PodGroup, BindRequest, Config, SchedulingShard, ...), generated clients, shared constants and resource/podgroup helpers live in the separate module github.com/kai-scheduler/api, not in this repo. API/CRD changes start with a PR there; after a tag is cut, bump it in go.mod.
Tools (/cmd/)
fairshare-simulator- Simulate fairshare scheduling decisionstime-based-fairshare-simulator- Time-based scheduling simulationsnapshot-tool- Cluster state snapshot utilitiesscalingpod- Helper for scaling pod operations
Code Style Guidelines
Import Organization
Organize imports in three groups separated by blank lines:
import (
// 1. Standard library
"context"
"fmt"
// 2. External dependencies
v1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
// 3. Internal packages
"github.com/kai-scheduler/KAI-scheduler/pkg/scheduler/api"
)Naming Conventions
- Files: snake_case (
bind_request_controller.go,node_info.go) - Types: PascalCase (
SchedulerCache,NodeInfo) - Interfaces:
-ersuffix orInterface(Plugin,SchedulerLogger) - Functions: PascalCase exported, camelCase unexported
- Boolean functions:
is/has/shouldprefix (IsTaskAllocatable) - Constants: PascalCase exported, camelCase unexported
Logging
Follow the logging practices in CONTRIBUTING.md.
Comments
- Apache 2.0 + NVIDIA copyright headers on all files
- GoDoc-style for exported functions/types
- kubebuilder RBAC markers:
// +kubebuilder:rbac:groups=core,resources=pods,verbs=get - DO NOT wrire obvious comments; explain "why" not "what"
- Keep comments short, concise and to the point.
General Patterns
- Context as first parameter:
func Foo(ctx context.Context, ...) - Pointer receivers for methods that modify state
- Interfaces in
interface.gofiles - Constructor functions return interface types:
func New(...) Cache - Use
deferfor cleanup and state restoration
Linter Configuration
Enabled linters (see .golangci.yaml):
gofmtunusedgoconsterrcheckgovet
Test files (*_test.go) have relaxed rules for goconst, errcheck, govet.
Pull Request Requirements
PR Title Format (Conventional Commits)
PR titles must follow conventional commit format: <type>(<scope>): <description>
Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
Scopes (optional): scheduler, binder, podgrouper, admission, operator, queue-controller, pod-group-controller, resource-reservation, chart, api, node-scale-adjuster, ci, release, docs, deps
PR Description format
When opening a PR, use the template in .github/pull_request_template.md for the PR description
Changelog Requirements
Changelog entries are changie fragments. Never edit CHANGELOG.md directly — it is the source of truth for released versions and is only written at release time. Never write fragment files by hand — always use make changelog.
# Add a fragment (non-interactive — required for agents)
# AUTHOR is the GitHub username to credit; ISSUE is the PR/issue number. Both required.
make changelog KIND=<kind> BODY="short description under 20 words" AUTHOR="<github-user>" ISSUE="<pr-or-issue-number>"
# Valid kinds: Added | Changed | Fixed | Removed
make changelog KIND=Fixed BODY="Scheduler exits on 401 instead of retrying indefinitely" AUTHOR="SomeUsername" ISSUE="1817"
make changelog KIND=Added BODY="Helm value to disable resource-reservation namespace creation" AUTHOR="SomeUsername" ISSUE="1820"
# Preview the next release section (optional)
make changelog-preview VERSION=v0.17.0- Add a fragment on every PR that changes behavior (adds functionality, fixes a bug, changes an API, or gives a significant perf win). Skip it for refactors, docs, tests, and CI changes — apply the
skip-changelog(ordependencies) label instead. CI fails a behavior PR that has neither. - Entries MUST be fewer than 20 words. Keep them clear and concise.
- Always set
AUTHOR(the PR author's GitHub username) andISSUE(the PR number, or a linked issue number if one exists) — omitting them drops attribution and traceability fromCHANGELOG.md. If the PR number isn't known yet, use the issue number; update the fragment once the PR is opened. - Commit the fragment with your code. Fragments never conflict between PRs or backports, so no coordination is needed.
Humans: make changelog with no args runs the interactive prompts.
Releasing (maintainers): don't fold the changelog by hand. Dispatch the Release — Prepare Changelog workflow with a version (e.g. v0.17.0) from the target branch — main for a minor/major, a v*.* branch for a patch. It folds the pending fragments into CHANGELOG.md, clears them, and opens a PR. Merging that PR auto-tags the version and publishes the GitHub Release.
Sub-chart versions: the chart declares gpu-fractioning as a version range (~0.1.0) rather than an exact pin, so a gpu-fractioning patch is picked up by the next chart build instead of needing a PR here. deployments/kai-scheduler/Chart.lock is therefore not tracked — it is local build output. helm dependency build resolves the range by itself when no lock is present, so every call site stays as it is.
Two things follow:
- A leftover local
Chart.lockfreezes you. Once a build writes one, later builds install that version and never re-check the registry. Runrm -f deployments/kai-scheduler/Chart.lockto pick up a newer gpu-fractioning. CI is unaffected — a fresh checkout never has one. - Which version shipped is recorded on the release, not in git: the
subcharts.yamlasset on the GitHub Release. Release — Prepare Changelog also adds a changelog entry by itself when the version moves, but that entry names no version — the changelog is written before the chart is built, so any version in it could be stale by then.subcharts.yamlis the only authoritative record.
CI Checks (on-pr.yaml)
PRs trigger: make validate → make test → make build → E2E tests
- Docs-only changes (
.mdfiles,docs/) skip build/test - E2E tests run with Ginkgo:
ginkgo -r --randomize-all ./test/e2e/suites
General Rules
- Use
git mvwhen moving files to preserve history - DO NOT add obvious comments that duplicate the code.
- Write comments ONLY when ABSOLUTELY necessary
- Keep Comments short, explicit and concise
- DO NOT use
I,weor any other pronoun
- When performing a major change, run
make validateafter changes
Philosophy & Design
- Documentation can be found in
docsfolder - Design documents for major features are in
docs/developer/designs/: - Usage Examples are in
examples
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

