Skip to content

[feature] add inflight to s_load makesure select best replica in star… - #6

Open
yyyyrrrrif wants to merge 18 commits into
touch869:router-devfrom
yyyyrrrrif:router-dev
Open

[feature] add inflight to s_load makesure select best replica in star…#6
yyyyrrrrif wants to merge 18 commits into
touch869:router-devfrom
yyyyrrrrif:router-dev

Conversation

@yyyyrrrrif

Copy link
Copy Markdown

…t phase

What does this PR do?

Add concise overview of what this PR aims to achieve or accomplish. Reference related GitHub issues and PRs that help with the review.

add inflight request to s_load compute.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, 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
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

ZOULQ and others added 11 commits July 7, 2026 20:57
 [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
touch869 force-pushed the router-dev branch 2 times, most recently from 9857e68 to 26e9587 Compare July 17, 2026 01:37
@touch869
touch869 force-pushed the router-dev branch 2 times, most recently from 7664af5 to 356dfd5 Compare July 17, 2026 03:28
@touch869
touch869 force-pushed the router-dev branch 2 times, most recently from c4afb24 to 712b29f Compare July 23, 2026 11:01
@touch869
touch869 force-pushed the router-dev branch 4 times, most recently from 10c7de8 to 6377862 Compare July 25, 2026 06:29
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.

5 participants