Repository navigation
[sgl-router] refactor - SLO ordering for bucket selection - #40292
Merged
Merged
Conversation
This was referenced Sep 19, 2026
Merged
sherlockwu
added this pull request to stack #40280
September 19, 2026 04:32
sherlockwu
force-pushed
the
codex/policies-reorg-slo
branch
from
September 19, 2026 04:42
a8a0afb to
ad42136
Compare
This was referenced Sep 19, 2026
sherlockwu
removed this pull request from stack #40280
September 19, 2026 17:34
sherlockwu
added this pull request to stack #40368
September 19, 2026 17:34
sherlockwu
removed this pull request from stack #40368
September 19, 2026 20:40
sherlockwu
added this pull request to stack #40380
September 19, 2026 20:40
sherlockwu
force-pushed
the
codex/policies-reorg-slo
branch
2 times, most recently
from
September 20, 2026 17:28
228bf18 to
d62a3ae
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
force-pushed
the
codex/policies-reorg-slo
branch
from
September 20, 2026 22:23
d62a3ae to
f743139
Compare
sherlockwu
force-pushed
the
codex/policies-reorg-slo
branch
from
September 20, 2026 23:49
f743139 to
3991ff3
Compare
sherlockwu
force-pushed
the
codex/policies-reorg-slo
branch
from
September 20, 2026 23:57
3991ff3 to
bc9f462
Compare
sherlockwu
force-pushed
the
codex/policies-reorg-slo
branch
from
September 21, 2026 00:22
bc9f462 to
06b128d
Compare
ShangmingCai
marked this pull request as ready for review
September 21, 2026 09:10
ShangmingCai
approved these changes
Sep 21, 2026
ShangmingCai
left a comment
Collaborator
There was a problem hiding this comment.
Logic is correct and genuinely well-tested, after a restack/rebase, we could launch the CI and merge it after CI passes.
Comment on lines
241
to
246
| pub fn new(buckets: Vec<Bucket>) -> Self { | ||
| Self { buckets } | ||
| Self { | ||
| buckets, | ||
| ..Self::default() | ||
| } | ||
| } |
Collaborator
sherlockwu
force-pushed
the
codex/policies-reorg-slo
branch
from
September 22, 2026 02:07
06b128d to
f9f5a00
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.
Add optional TTFT and token-throughput preferences to bucket selection. Length constraints remain mandatory; SLO preferences order the compatible buckets before engine selection. Each PD attempt still obtains both engines from one bucket, and nonpreferred buckets remain available for fallback.
Based directly on
main; the cache-aware changes from #40366 and admission changes from #40271 are already merged.Changes
Bucketand independent resolver preferences:Disabled(default),SloFirst(matching first), orBestEffort(nonmatching first).SloFirst, buckets matching both targets precede those matching one, followed by those matching neither.BucketResolver::resolve. Parsex-sgl-ttft-slo-msandx-sgl-tps-sloin the shared chat route only when their preference is enabled; invalid enabled headers return 400 before dispatch, while disabled headers are ignored.Preferences are configured programmatically on reorg resolvers. Legacy routing remains the default; production configuration construction remains a follow-up.
Validation after rebase
Rebased only the SLO commit onto
main(9eda772a21), excluding the already-merged cache-aware and admission commits. PreserveBucketResolver::newstage validation and itsResultreturn type from #40366; adapt SLO test constructors to that API. Cache-aware and admission policy implementations and their regression tests remain identical tomain.cargo fmt --all --checkcargo test --locked --workspace --lib --tests --quiet: 1,117 tests passed, none skipped.cargo clippy --locked --workspace --all-targets -- -D warningsgit diff --checkCI States
Latest PR Test (Base): ✅ Run #35678290678
Latest PR Test (Extra): ❌ Run #35678290559
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.