Repository navigation
[sgl-router] refactor - cache-aware policy - #40366
Merged
Merged
Conversation
This was referenced Sep 19, 2026
Merged
sherlockwu
added this pull request to stack #40368
September 19, 2026 17:34
This was referenced Sep 19, 2026
sherlockwu
marked this pull request as draft
September 19, 2026 20:23
sherlockwu
removed this pull request from stack #40368
September 19, 2026 20:40
sherlockwu
changed the base branch from
codex/policies-reorg-skeleton
to
codex/policies-reorg-session-aware
September 19, 2026 20:40
sherlockwu
added this pull request to stack #40380
September 19, 2026 20:40
sherlockwu
added a commit
that referenced
this pull request
Sep 19, 2026
CacheAwarePolicy picks within one plain or prefill group following the legacy cache_aware proposal and resolve_cache_candidates rules: exact-URL prefix holders from a local radix tree or remote indexer, hit thresholds, bounded candidates, soft queue gate, saturation pin, pressure guard, and EngineAdmission on every candidate and on the power-of-two fallback pick. PrefixMemo shares one lookup per request and source across bucket attempts. Squashed from #40366 and rebased onto the renamed load-monitor modules (engine_reported_load, router_inflight_load). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
sherlockwu
force-pushed
the
codex/policies-reorg-cache-aware
branch
from
September 19, 2026 23:09
236b3b7 to
0277756
Compare
sherlockwu
added a commit
that referenced
this pull request
Sep 19, 2026
CacheAwarePolicy picks within one plain or prefill group following the legacy cache_aware proposal and resolve_cache_candidates rules: exact-URL prefix holders from a local radix tree or remote indexer, hit thresholds, bounded candidates, soft queue gate, saturation pin, pressure guard, and EngineAdmission on every candidate and on the power-of-two fallback pick. PrefixMemo shares one lookup per request and source across bucket attempts. Squashed from #40366 and rebased onto the renamed load-monitor modules (engine_reported_load, router_inflight_load). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
sherlockwu
force-pushed
the
codex/policies-reorg-cache-aware
branch
from
September 19, 2026 23:15
0277756 to
f455093
Compare
sherlockwu
marked this pull request as ready for review
September 20, 2026 00:02
sherlockwu
added a commit
that referenced
this pull request
Sep 20, 2026
CacheAwarePolicy picks within one plain or prefill group following the legacy cache_aware proposal and resolve_cache_candidates rules: exact-URL prefix holders from a local radix tree or remote indexer, hit thresholds, bounded candidates, soft queue gate, saturation pin, pressure guard, and EngineAdmission on every candidate and on the power-of-two fallback pick. PrefixMemo shares one lookup per request and source across bucket attempts. Squashed from #40366 and rebased onto the renamed load-monitor modules (engine_reported_load, router_inflight_load). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
sherlockwu
force-pushed
the
codex/policies-reorg-cache-aware
branch
from
September 20, 2026 00:04
f455093 to
386f656
Compare
sherlockwu
added a commit
that referenced
this pull request
Sep 20, 2026
CacheAwarePolicy picks within one plain or prefill group following the legacy cache_aware proposal and resolve_cache_candidates rules: exact-URL prefix holders from a local radix tree or remote indexer, hit thresholds, bounded candidates, soft queue gate, saturation pin, pressure guard, and EngineAdmission on every candidate and on the power-of-two fallback pick. PrefixMemo shares one lookup per request and source across bucket attempts. Squashed from #40366 and rebased onto the renamed load-monitor modules (engine_reported_load, router_inflight_load). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
sherlockwu
force-pushed
the
codex/policies-reorg-cache-aware
branch
from
September 20, 2026 17:28
386f656 to
c2de8bb
Compare
sherlockwu
removed this pull request from stack #40380
September 20, 2026 17:28
sherlockwu
added this pull request to stack #40484
September 20, 2026 17:28
sherlockwu
added a commit
that referenced
this pull request
Sep 20, 2026
CacheAwarePolicy picks within one plain or prefill group following the legacy cache_aware proposal and resolve_cache_candidates rules: exact-URL prefix holders from a local radix tree or remote indexer, hit thresholds, bounded candidates, soft queue gate, saturation pin, pressure guard, and EngineAdmission on every candidate and on the power-of-two fallback pick. PrefixMemo shares one lookup per request and source across bucket attempts. Squashed from #40366 and rebased onto the renamed load-monitor modules (engine_reported_load, router_inflight_load). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
sherlockwu
force-pushed
the
codex/policies-reorg-cache-aware
branch
from
September 20, 2026 22:23
c2de8bb to
7281f5c
Compare
sherlockwu
force-pushed
the
codex/policies-reorg-cache-aware
branch
from
September 20, 2026 23:49
7281f5c to
8aa10f1
Compare
sherlockwu
force-pushed
the
codex/policies-reorg-cache-aware
branch
from
September 20, 2026 23:57
8aa10f1 to
1802ef2
Compare
CacheAwarePolicy picks within one plain or prefill group following the legacy cache_aware proposal and resolve_cache_candidates rules: exact-URL prefix holders from a local radix tree or remote indexer, hit thresholds, bounded candidates, soft queue gate, saturation pin, pressure guard, and EngineAdmission on every candidate and on the power-of-two fallback pick. PrefixMemo shares one lookup per request and source across bucket attempts. Squashed from #40366 and rebased onto the renamed load-monitor modules (engine_reported_load, router_inflight_load). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
sherlockwu
force-pushed
the
codex/policies-reorg-cache-aware
branch
from
September 21, 2026 00:22
1802ef2 to
0ce1985
Compare
…ver is built A CacheAwarePolicy installed on a decode group was only detected inside pick(), where the chat reorg path treats InvalidConfiguration as fatal and turns every request into a 500. Policies now declare the stages they support and BucketResolver::new validates each bucket's groups up front. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ShangmingCai
approved these changes
Sep 21, 2026
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.
Add cache-aware selection to the bucket engine groups introduced by #40241. Plain and prefill groups can prefer workers holding a usable prefix, while cache misses fall back to power-of-two selection within that group's soft queue tier.
Stack: main → #40272 (shared state) → #40241 (bucket routing and power-of-two) → #40379 (session-aware) → #40366 (cache-aware) → #40271 (admission) → #40292 (SLO ordering).
EngineAdmission. Hard rejection advances to another bucket; saturation never bypasses admission. Concrete named metric limits are integrated in [sgl-router] refactor - generalized admission policy definitions #40271.The HTTP cache regression seeds the prefix index with tokens produced by the configured tokenizer, matching request preparation on this base.
Legacy routing remains the default. Reorg policies are constructed programmatically; production config wiring, power-of-k fallback configuration, and cache decision metrics remain follow-ups.
Validation after rebase
Rebased the stack onto
main(95521da18d) after #39867 merged. All 31 commit patches and each PR's router tree are unchanged. Formatting and diff checks pass after this rebase. Clippy and workspace tests passed on the identical router tree in the previous rebase: 1,100 passed, with two Hugging Face cache-dependent parity tests excluded.PR-specific validation from the unchanged router trees:
cargo +nightly fmt --all -- --checkcargo +1.92 clippy --locked --workspace --all-targets -- -D warningscargo +1.92 test --locked --test component --test proxy -- --skip parity_matrix: 103 component and 136 proxy tests passed. Two Hugging Face cache-dependent parity tests excluded.CI States
Latest PR Test (Base): ✅ Run #35553896652
Latest PR Test (Extra): ❌ Run #35553896587
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.