Repository navigation
[sgl-router] policies_reorg: build pools from ModelConfig - #40273
Closed
sherlockwu wants to merge 1 commit into
Closed
sherlockwu wants to merge 1 commit into
sherlockwu wants to merge 1 commit into
Conversation
factory::build_pools turns the model's policy, decode policy and bucket JSON into prefill and decode pools with one policy instance per bucket. A bucket may override the model policy via a new optional `policy` field. Migrated admission stays explicit: capacity for power-of-two style kinds, the bucket's pending-prefill budget, and the --filter overloaded in-flight limit. Pools becomes a struct because PD versus plain is only known from discovered worker modes; the prefill pool also serves plain requests. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Collaborator
Author
|
Closing: the series stops at the power-of-two PR (#40271) for now. |
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.
Motivation
Third PR of the engine-selection redesign, on top of #40271. Connects configuration to the new resolver: each bucket gets its own policy instance and admission, and a bucket can override the model's
--policy.Modifications
policies_reorg/factory.rs:build_pools(&ModelConfig)builds the prefill pool (also used for plain requests) and the decode pool. Buckets come from the bucket JSON; a stage without buckets gets one implicit catch-all bucket running the model policy (decode: power-of-two). Unsupported kinds (fused_score,score_policy,legacy_host_affinity, and the affinity/cache kinds until their PRs) are rejected at build time.Capacityfor power-of-two, session-aware and cache-aware kinds; the bucket'smax_pending_prefill_tokensas a per-bucketPendingPrefillcheck;--filter overloadedwith--max-in-flightasInFlightLimit. Since each bucket has its own policy instance, the pending-prefill budget is one number, not a per-engine map.config::BucketSpec.policy: Option<PolicyKind>(serde default, snake_case) is the per-bucket override. Existing literals gainpolicy: None.buckets_reorg::Poolsis now{ prefill, decode }instead of an enum: whether a deployment is PD is only known from discovered worker modes, and the design says prefill buckets also apply to plain requests.Pools::plainbuilds one with an empty decode pool.admission::PendingPrefilladded.Checklist
cargo clippy --locked --workspace --all-targets -- -D warningscleancargo test --lib policies_reorg(5),cargo test --test component policies_reorg(6), plus the legacyconfigandproxy buckettests pass🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ✅ Run #35410111714
Latest PR Test (Extra): ❌ Run #35410111580
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.