Skip to content

feat: Add scheduler scoringStrategy Helm value for GPU spread - #449

Merged
pre merged 2 commits into
mainfrom
feat/scheduler-scoring-strategy-value
Jul 10, 2026
Merged

feat: Add scheduler scoringStrategy Helm value for GPU spread#449
pre merged 2 commits into
mainfrom
feat/scheduler-scoring-strategy-value

Conversation

@pre

@pre pre commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Expose scheduler.scoringStrategy in the operator chart values so the NodeResourcesFit GPU scoring can switch between bin-pack and spread without a code change.
  • Default is RequestedToCapacityRatio (bin-pack), which reproduces current behavior exactly. Set to LeastAllocated to spread GPU workloads across nodes.
  • config/static/scheduler/* is left untouched (non-Helm default stays bin-pack).

Why

For the AMD Advancing AI demo on MI350X nodes we want GPU workloads spread across nodes rather than bin-packed next to each other (heat/locality). This adds a values toggle so deployments (e.g. via GitOps values override) can pick the spread strategy without waiting on a code change.

Implementation

chart/templates/scheduler.yaml includes the raw scheduler-resources.yaml ConfigMap via .Files.Get. When scheduler.scoringStrategy=LeastAllocated, the template rewrites the RequestedToCapacityRatio block to LeastAllocated (same GPU resource weights). Uses backtick raw strings for readability.

Test plan

  • helm template . renders bin-pack by default (identical to current main)
  • helm template . --set scheduler.scoringStrategy=LeastAllocated renders type: LeastAllocated
  • Full chart render valid in both modes
  • Deploy to a cluster and confirm kaiwo-scheduler-config ConfigMap reflects the selected strategy (kube-scheduler needs a rollout restart, no hot-reload)

Note: this is node-level spread only. Intra-node GPU/PCIe placement is out of scope (would need the DRA driver).

🤖 Generated with Claude Code

Expose scheduler.scoringStrategy in chart values so the NodeResourcesFit
GPU scoring can switch from bin-pack (RequestedToCapacityRatio, default)
to spread (LeastAllocated) without a code change. Default preserves current
behavior.
@pre
pre marked this pull request as ready for review July 9, 2026 13:48
@pre

pre commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Tested in a two node MI350X cluster (further testing will be done later when more nodes available):

  • With default RequestedToCapacityRatio GPU workloads prefer to fill a single node first, while the other one is idle.
  • With LeastAllocated GPU workloads are spread among the two nodes.

@salexo salexo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks good, just one change request, we could try to fail fast on unknown values, for example

{{- $strategy := .Values.scheduler.scoringStrategy }}
{{- if not (or (eq $strategy "RequestedToCapacityRatio") (eq $strategy "LeastAllocated")) }}
{{- fail (printf "scheduler.scoringStrategy must be RequestedToCapacityRatio or LeastAllocated, got %q" $strategy) }}
{{- end }}

@pre
pre force-pushed the feat/scheduler-scoring-strategy-value branch from 5338251 to e93f9bb Compare July 10, 2026 09:20
@pre

pre commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@salexo how about now?

@pre
pre enabled auto-merge (squash) July 10, 2026 11:36

@salexo salexo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pre
pre merged commit 3a46fb9 into main Jul 10, 2026
10 checks passed
@pre
pre deleted the feat/scheduler-scoring-strategy-value branch July 10, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants