feat(scheduler): warmup before global rebalance #204
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve Scheduler Global Rebalancing Mechanism and Node Rebalancing Tests
Summary
This PR improves the scheduler's global rebalancing mechanism, optimizes the warmup and truncation process, and adds unit tests for node rebalancing. The main changes include:
bootstrapmethod to support both initialization and global rebalancing modesTechnical Details
Warmup and Truncation Mechanism
The warmup phase identifies turning points through layer-level dynamic programming:
Global Rebalancing Flow
clear_existing=True)skip_warmup=Falseandrequest_warm_up_for_reshard > 0)Impact
Modified Files
src/scheduling/scheduler.py: Main changes, refactored bootstrap and rebalancing logicsrc/scheduling/layer_allocation.py: Addedreallocatemethodsrc/scheduling/request_routing.py: Changedfind_turning_pointsto static methodtests/scheduler_tests/test_scheduler.py: Added node rebalancing testsBackward Compatibility
bootstrap()method default behavior unchanged (clear_existing=False, skip_warmup=False)Testing
New Tests
test_scheduler_three_nodes_sequential_join_leave_rejoin: Validates rebalancing behavior in multi-node scenariosTest Coverage
Benefits