Skip to content

[serve][7/8] Rebalance replicas toward their topology rules - #68368

Draft
YashwanthRanjanSingaravel wants to merge 1 commit into
feat/spread-required-apifrom
feat/spread-rebalance
Draft

YashwanthRanjanSingaravel wants to merge 1 commit into
feat/spread-required-apifrom
feat/spread-rebalance

Conversation

@YashwanthRanjanSingaravel

@YashwanthRanjanSingaravel YashwanthRanjanSingaravel commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Moves a running replica to a node with room where it holds more of its rules.
  • A move must raise the deployment's coverage, so moves never loop. Ties break by id.
  • Moves reuse compaction's migration path, timeout and backoff, with a fixed target node.
  • A deployment moves replicas only after staying HEALTHY for the compaction delay.
  • Held replicas no longer keep compaction off.
  • A rollout stops an outdated replica in a domain a held replica needs. Part of [Serve] [RFC] Topology spread rules for replica scheduling #68000.

Changes

  • deployment_scheduler.py:
    • plan_rebalance_move, and rebalance with a backoff per deployment.
    • Move replacements bind to the planned node and keep the replica's fallbacks.
    • get_held_replicas, get_outdated_replicas_to_stop.
  • deployment_state.py:
    • Migrates moved replicas start then stop, and gates moves per deployment.
    • Leaves held replicas out of the compaction gate.
    • Stops the outdated replicas that held ones need.
  • constants.py: RAY_SERVE_REBALANCE_RULES, default on.

Tests

  • test_deployment_scheduler.py, test_deployment_state.py: plans, moves, gates, rollouts.
  • Serve unit tests: scheduler, rules, state, config, schema, version, deployment, app state.
    • RAY_SERVE_USE_PACK_SCHEDULING_STRATEGY=0: 3960 passed.
    • RAY_SERVE_USE_PACK_SCHEDULING_STRATEGY=1, scheduler and state: 586 passed.

This branch has not been deployed

No deployments
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.

1 participant