[feature] add inflight to s_load makesure select best replica in star… - #6
Open
yyyyrrrrif wants to merge 18 commits into
Open
[feature] add inflight to s_load makesure select best replica in star…#6yyyyrrrrif wants to merge 18 commits into
yyyyrrrrif wants to merge 18 commits into
Conversation
[rollout] feat: extract load balancing router strategy
support kv-event in multi replica
…contract - Split flat router.py into a router/ package mirroring engine/base.py. - RequestLoadBalancer Protocol declares the __init__(servers, config) contract. - LoadBalancerRegistry registers strategies via decorator; get_router_handle dispatches. - Move GlobalRequestLoadBalancer to global_balancer.py; fix zip subscript typo. - Add RolloutConfig.router_config field. - Expose get_rollout_config() on the vLLM server for external routers.
- Register the kvcaware strategy via the decorator. - Add the KVCAwareBalancer orchestration shell. - Add the kvcaware subsystem skeleton: config, strategies, collectors, store interfaces, types, logging. - Package imports cleanly and the strategy registers; no working balancer constructed yet.
- Add KVCacheStore / MetricsStore / StickySessionStore singletons. - Wire DataStore top-level sub-store imports (C2 left them as a cut). - Add xxhash chained prefix-hash utils (get_prefix_hashes / compute_hash). - Add store unit tests (sticky+incr delegation, prefix-chain match). Store layer is now import-clean and DataStore constructs; no collector/strategy impl yet.
- Add concrete transports: Callback / HTTP (httpx) / ZMQ (pyzmq). - Add decoders: basic (Inflight, Sticky) + vllm (KV, Metrics, KVCacheEvent). - Wire transport/__init__ eager re-exports (C2 left them as a cut). - get_collector factory now resolves all four collector names. Collectors import-clean and drive DataStore; ut/cpu tests green (22 passed). st/gpu tests (real vLLM) deferred to the NPU/GPU container.
- Add KVCacheAwareStrategy (load + cache + sticky-shortcut scoring). - Register it in StrategyRegistry via strategies/__init__ side-effect import (C2 left the registry empty). - route() now ranks real replicas against store metrics. Strategy layer complete; balancer can now resolve the kvcaware strategy. ut/cpu tests green (81 passed).
- Wire the balancer end-to-end: orchestration tests (unit/sticky/ray-integration), kvcaware.yaml Hydra group, test_config compose tests, ci_test.sh, top-level conftest. - Add e2e tests (router + mooncake) driving run_infer.sh over a real vLLM agent loop. - Fix get_router_handle struct-mode bug: mutating full_determinism on a Hydra-composed router_config node raised ConfigKeyError; materialize the node to a plain dict first (production-only — ut used non-struct configs and missed it). - Add the generic (GPU) example: parallel_infer.py (MooncakeStoreConnector, kv-events, oc.select-derived fields), run_infer.sh, agent configs, READMEs. - Simplify kvcaware/ comments: drop stale FQN/migration-history/external-doc references, trim verbose docstrings; license headers consistent across the package. Verified on the GPU container (vllm 0.21): ci_test ut 233 / st-cpu 5 / st-gpu 11 / e2e 2, all PASS.
…lter + slow_cut config fields - Add SlowCut enum (prefix-load-aware / least-inflight) to kvcaware.types; export from types. - Add memory_overload_filter (bool, default True) and slow_cut (SlowCut, default prefix-load-aware) to KVCAwareStrategyConfig, with yaml-str→SlowCut coercion + validation in __post_init__ (mirrors the Layer pattern). - plot_metrics.py: refactor into an OOP panel design (LogParser + Panel hierarchy — FieldPanel / MFUPanel(SlidingPanel) / EvictPanel(CumulativePanel); the extract/transform/ derive/draw/summarize hooks absorb the per-metric free functions).
touch869
force-pushed
the
router-dev
branch
2 times, most recently
from
July 17, 2026 01:37
9857e68 to
26e9587
Compare
touch869
force-pushed
the
router-dev
branch
2 times, most recently
from
July 17, 2026 03:28
7664af5 to
356dfd5
Compare
add kvc_aware_router
[rollout][feat] add inflight to s_load
…mpt-length, route latency, load panels + dispatch plots)
touch869
force-pushed
the
router-dev
branch
2 times, most recently
from
July 23, 2026 11:01
c4afb24 to
712b29f
Compare
touch869
force-pushed
the
router-dev
branch
4 times, most recently
from
July 25, 2026 06:29
10c7de8 to
6377862
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…t phase
What does this PR do?
add inflight request to s_load compute.
Checklist Before Starting
[{modules}] {type}: {description}(This will be checked by the CI){modules}includefsdp,megatron,veomni,sglang,vllm,rollout,trainer,ci,training_utils,recipe,hardware,deployment,ray,worker,single_controller,misc,perf,model,algo,env,tool,ckpt,doc,data,cfg,reward,fully_async,one_step_off,like[megatron, fsdp, doc]{type}is infeat,fix,refactor,chore,test[BREAKING]to the beginning of the title.[BREAKING][fsdp, megatron] feat: dynamic batchingTest
API and Usage Example
# Add code snippet or script demonstrating how to use thisDesign & Code Changes
Checklist Before Submitting
Important
Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.
pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=alwaysci-requestchannel in theverlSlack workspace. (If not accessible, please try the Feishu group (飞书群).)recipesubmodule, please also update the reference to the submodule commit viagit submodule update --remoteorcd recipe && git pull origin main.