[CORE] Implement Worker Controller for Dynamic Model Loading and Inference, Reducing Cold Start Latency of Workers #15
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.
[Core] Introduce Worker Controller for Dynamic Model Orchestration
Description
This PR introduces a Worker Controller architecture designed to decouple worker lifecycle management from the execution loop. This architecture allows for the maintenance of a pool of pre-warmed "dummy" workers that can be dynamically assigned to new engines, enabling efficient model loading and unloading without requiring process restarts.
Key Components
1. Worker Controller (
worker_controller.py)2. Proxy Executor (
proxy_executor.py)3. Remote Executor (
remote_executor.py)Worker & Engine Customization
To support this architecture, the following core components were enhanced:
vllm/worker_controller/worker/gpu_worker.py: Enhanced Worker to support dynamicload_modelandunload_modeloperations without process restart.vllm/worker_controller/worker/model_runner.py: CustomModelRunnertailored for the controller architecture.vllm/worker_controller/engine/core.py: CustomEngineCoreimplementation with added load_model RPC hooks.Documentation
vllm/worker_controller/README.mdcontaining a detailed architecture overview and Mermaid diagrams illustrating the flow.Testing Steps
New test scripts were added to verify the lifecycle and parallel capabilities:
Lifecycle Verification (
inference.py):Load -> Inference -> Unload -> Load.Parallel Inference (
test_parallel_inference.py):facebook/opt-125mandQwen/Qwen3-0.6B) simultaneously.Dynamic Allocation (
test_dynamic_allocation.py):facebook/opt-125mandQwen/Qwen3-0.6B.facebook/opt-125m.Qwen/Qwen3-0.6B.FIX #xxxx