Repository navigation
docs(routing): cover pressure-aware selection and the hash index in cache-aware routing - #49
Merged
Merged
Conversation
…ache-aware routing Rewrite the decision flow from v1.11 code: per-request spill gate, KV-pressure triggers, overlap decay, temperature and expected-wait fallback (smg-project/smg#2161, #2117, #2341); add the hash index, tree budget, cache partitions, mesh sync and metrics (#2213, #2137, #2435, #2119, #2515). KV events guide: SGLang replay and gap recovery, indexer bounds, current engine flags (#2673, #2672, #2225, #2095, #2495). Drop unattributed benchmark numbers and the diagrams of the old algorithm. Signed-off-by: Simo Lin <25425177+slin1237@users.noreply.github.com>
|
Warning Review limit reachedNext included review available in 23 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. Your 65 included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Comment |
- Drop the worker spec kv_block_size step from the block-size order; the create step never copies the field, so v1.11.0 accepts it but ignores it. - Mesh sync: best effort and approximate, not eventually consistent. td: batches are sent once and dropped on backpressure; there is no drop-oldest broadcast buffer. Repair starts on the next unknown path and gives up after three retries. - vLLM/TokenSpeed: a gap loops on reconnect (the bridge ignores the cursor), freezing that worker's index entries until the worker is removed. - Examples use smg launch; SGLang uses --smg-grpc-mode and mentions the --port + 1 sidecar. - Note the Python launcher's 60 s eviction default and that it lacks the --kv-indexer-* flags. - Hash index covers token-bearing requests only; the KV-event index also changes on worker removal and pruning; missing-subscription causes include a non-cache_aware --policy; fix the TokenSpeed upstream path. Signed-off-by: Simo Lin <25425177+slin1237@users.noreply.github.com>
Only the tree-path inserts publish deltas (sync_local_insert). The KV-pressure fallback records locally without publishing, and the PD/EPD leg policies are created after the mesh attaches its adapter, so they never publish. Signed-off-by: Simo Lin <25425177+slin1237@users.noreply.github.com>
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.
cache_awarechanged substantially in v1.10 and v1.11, and the page still described the old algorithm: a fleet-wide "imbalanced" switch, and misses routed to "most cache capacity". It also claimed the tree "mirrors backend KV cache 100%". The changes it missed:--cache-index hashwith--cache-boundariesand--cache-ttl-secs.Changes
concepts/routing/cache-aware.md(rewritten from the v1.11 code)cache_salt,extra_key, LoRA; HTTP only).getting-started/kv-events-cache-aware.md--cache-index hashbypasses the event index.--cache-thresholddefaults to 0.3 and does not apply to event-driven routing.--prefix-granularity.replay_endpoint.Verification
v1.11.0(3be823a7):policies/cache_aware.rs,policies/cache_namespace.rs,policies/mod.rs(built-in defaults verified)crates/kv_index,worker/kv_event_monitor.rs,mesh/adapters/tree_sync.rsgrpc_servicer/smg_grpc_servicer/{sglang,vllm,tokenspeed}/kv_events.py,main.rs,observability/metrics.rspnpm lint,pnpm check(0 errors), andpnpm buildpass.request-streaming.md(docs: document request body streaming and upstream HTTP/2 #47) andoverload-protection.md(docs(reliability): document worker overload protection and load monitoring #37), which are added by sibling PRs.wrangler pages dev.This is one of a series of docs PRs that bring the site up to smg v1.11.0, one per area.
🤖 Generated with Claude Code