Search before asking
Description
Motivation
KubeRay already supports integration with Kubernetes batch schedulers such as Volcano for gang scheduling.
However, as Ray workloads become more dynamic and elastic, there are still open questions around how Ray Autoscaler should interact with external schedulers when both components influence workload lifecycle.
Today we have multiple control loops:
These components may make independent decisions about the same workload, which can lead to unexpected behaviors during dynamic resource changes.
Example Scenario
Consider a Ray cluster running on a heterogeneous Kubernetes cluster:
Initially, due to resource availability, some CPU Ray worker pods may be scheduled onto GPU nodes.
Later, a GPU workload arrives and requires those GPU nodes.
Ideally:
-
The scheduler identifies that GPU workloads have higher priority.
-
CPU worker pods are preempted from GPU nodes.
-
CPU workers are rescheduled onto CPU nodes.
-
Ray Autoscaler adjusts node groups accordingly:
- scale down unused GPU capacity
- scale up CPU capacity if needed
However, during this transition:
- Ray workers may temporarily disappear.
- Ray Autoscaler may interpret missing workers as insufficient capacity and scale out.
- The scheduler may keep the workload waiting due to gang constraints.
- The workload PodGroup may enter an
InQueue state.
This creates potential conflicts between scheduler decisions and Ray Autoscaler decisions.
Open Questions
1. How should Ray Autoscaler react to scheduler-driven pod lifecycle changes?
When a Ray worker pod disappears because of scheduler actions:
- preemption
- eviction
- gang scheduling transition
Should Ray Autoscaler:
- immediately treat it as a missing worker and create replacement capacity?
- wait for the scheduler to complete rescheduling?
- distinguish between workload failure and scheduler-driven migration?
Is there a recommended signal/mechanism for Ray Autoscaler to understand the reason behind worker changes?
2. Should Ray Autoscaler be aware of gang scheduling states?
For workloads requiring a minimum number of workers:
Example:
desired workers: 10
running workers: 6
PodGroup: InQueue
Currently, Ray Autoscaler may see missing workers and attempt scaling actions.
Should Ray Autoscaler:
- understand external scheduler admission states?
- avoid scaling while the workload is waiting for gang admission?
- coordinate with scheduler-provided signals such as PodGroup status?
3. What is the recommended ownership boundary between KubeRay and external schedulers?
Possible models:
Scheduler-driven model
Volcano/Kueue owns:
- placement
- admission
- preemption
Ray Autoscaler only reacts to final cluster state.
Questions:
- How does Ray avoid overreacting to temporary scheduler states?
Ray-aware model
Ray Autoscaler understands:
- gang requirements
- scheduler constraints
- migration events
Questions:
- Should KubeRay expose additional integration points?
- Should Ray workload requirements be propagated to Kubernetes scheduling frameworks?
Goal
The goal is to define a better integration model between:
- KubeRay / Ray Autoscaler
- Kubernetes gang schedulers (Volcano, Kueue, etc.)
- Kubernetes cluster autoscaling
for elastic Ray workloads.
This is not limited to distributed training workloads. The same challenges may appear in:
- Ray placement groups
- actor workloads with resource dependencies
- mixed CPU/GPU clusters
- dynamic workload rebalancing
We would appreciate feedback from the community on the recommended architecture and potential improvements.
Use case
No response
Related issues
No response
Are you willing to submit a PR?
Search before asking
Description
Motivation
KubeRay already supports integration with Kubernetes batch schedulers such as Volcano for gang scheduling.
However, as Ray workloads become more dynamic and elastic, there are still open questions around how Ray Autoscaler should interact with external schedulers when both components influence workload lifecycle.
Today we have multiple control loops:
Ray Autoscaler
Kubernetes scheduler / Volcano
These components may make independent decisions about the same workload, which can lead to unexpected behaviors during dynamic resource changes.
Example Scenario
Consider a Ray cluster running on a heterogeneous Kubernetes cluster:
Initially, due to resource availability, some CPU Ray worker pods may be scheduled onto GPU nodes.
Later, a GPU workload arrives and requires those GPU nodes.
Ideally:
The scheduler identifies that GPU workloads have higher priority.
CPU worker pods are preempted from GPU nodes.
CPU workers are rescheduled onto CPU nodes.
Ray Autoscaler adjusts node groups accordingly:
However, during this transition:
InQueuestate.This creates potential conflicts between scheduler decisions and Ray Autoscaler decisions.
Open Questions
1. How should Ray Autoscaler react to scheduler-driven pod lifecycle changes?
When a Ray worker pod disappears because of scheduler actions:
Should Ray Autoscaler:
Is there a recommended signal/mechanism for Ray Autoscaler to understand the reason behind worker changes?
2. Should Ray Autoscaler be aware of gang scheduling states?
For workloads requiring a minimum number of workers:
Example:
Currently, Ray Autoscaler may see missing workers and attempt scaling actions.
Should Ray Autoscaler:
3. What is the recommended ownership boundary between KubeRay and external schedulers?
Possible models:
Scheduler-driven model
Volcano/Kueue owns:
Ray Autoscaler only reacts to final cluster state.
Questions:
Ray-aware model
Ray Autoscaler understands:
Questions:
Goal
The goal is to define a better integration model between:
for elastic Ray workloads.
This is not limited to distributed training workloads. The same challenges may appear in:
We would appreciate feedback from the community on the recommended architecture and potential improvements.
Use case
No response
Related issues
No response
Are you willing to submit a PR?