Repository navigation
refactor(router): selection policy source, SelectionHost, and dead-flag removal - #49
Closed
ishandhanani wants to merge 5 commits into
Closed
ishandhanani wants to merge 5 commits into
ishandhanani wants to merge 5 commits into
Conversation
ishandhanani
had a problem deploying
to
external_collaborator
September 4, 2026 03:18 — with
GitHub Actions
Failure
ishandhanani
force-pushed
the
idhanani/up-5-policy-source
branch
from
September 4, 2026 04:00
f09fd90 to
3ad0344
Compare
ishandhanani
had a problem deploying
to
external_collaborator
September 4, 2026 04:00 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
September 4, 2026 04:00 — with
GitHub Actions
Failure
ishandhanani
force-pushed
the
idhanani/up-5-policy-source
branch
from
September 9, 2026 18:30
3ad0344 to
aa4817b
Compare
ishandhanani
had a problem deploying
to
external_collaborator
September 9, 2026 18:30 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
September 9, 2026 18:30 — with
GitHub Actions
Failure
The embedded selection partition is the only scheduler, so the flag has been a no-op since the runtime scheduler was deleted. It never shipped in a release, so no wire compatibility shim is needed: drop it from KvRouterConfig (Rust and serde), the DYN_ROUTER_EMBEDDED_SELECTION environment override, the Python argument group, the bindings signature, and the frontend configuration reference. Signed-off-by: Ishan Dhanani <[email protected]>
…router KvRouter, RoutingHost, RoutePlan, RequestGuard, PrefillRouter, ManagedKvRouter, ModelWatcher, and PreprocessedRouting were generic over a caller-injected WorkerSelector type that only ever named the policy the embedded partition would run. Replace the parameter with SelectionPolicySource: Registry (the linked policy the router config names, else Dynamo's default) or Factory (an explicit WorkerSelectionPolicyFactory). The router resolves it once at construction and instantiates one policy to learn the worker inputs it needs, so shared-cache and indexer gating are unchanged. ModelManager constructors take the policy source in place of a selector (kv_chooser_for_with_policy[_and_client], managed_kv_router_for_with_policy); HttpFrontend, ModelWatcher, and PrefillRouter carry it instead of a per-model selector factory. The bindings' custom-policy feature no longer needs a separate router type. The delegating-selector adapter in the embedded backend is removed with its only caller. Unit tests that injected fake selectors now inject picker or filter policies through the public worker-selection API; the overload test becomes a filtered-workers test because a policy cannot report overload directly. Signed-off-by: Ishan Dhanani <[email protected]>
DelegatedWorkerSelector, ErasedWorkerConfig, and the Delegated policy state existed only so the frontend could run an arbitrary caller-injected WorkerSelector type on a partition. That path is gone with the selector type parameter; custom policies use WorkerSelectionPolicy's filter, scorer, and picker API like every other host. Signed-off-by: Ishan Dhanani <[email protected]>
…ionHost
SelectionHostHooks was a flat bag of eight optional fields. Regroup it by
purpose as SelectionHost { load, cache, eligibility, telemetry, replication },
each group defaulting to the standalone service's behavior so a host sets only
the groups it owns. The builder method becomes SelectionServiceBuilder::host.
No behavior change; the frontend's embedded partition sets the same values.
Signed-off-by: Ishan Dhanani <[email protected]>
Signed-off-by: Ishan Dhanani <[email protected]>
ishandhanani
force-pushed
the
idhanani/up-5-policy-source
branch
from
September 9, 2026 19:06
aa4817b to
9cb836b
Compare
ishandhanani
had a problem deploying
to
external_collaborator
September 9, 2026 19:06 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
September 9, 2026 19:06 — with
GitHub Actions
Failure
This branch had an error being deployed
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.
PR 5 of 9 implementing ai-dynamo#14310 (one
SelectionCorefor the frontend, the standalone selection service, and the EPP). Base:idhanani/up-4-delete-kvscheduler(PR 4 of this stack).Summary
Replaces the frontend router's selector type parameter with an explicit
SelectionPolicySourceand groups host inputs intoSelectionHost. This removes the temporary compatibility interfaces left after deleting the runtime scheduler.Implementation
SelectionPolicySource::RegistryorFactoryinstead of threading<Sel>through router, discovery and request-lifecycle types.DelegatedWorkerSelector,ErasedWorkerConfigand their now-unused policy state.Walkthrough
Policy resolution
The registry source resolves a linked policy named by configuration, falling back to Dynamo's default policy when no linked policy is selected. The factory source supplies an explicit policy factory. Construction inspects policy worker inputs to preserve indexer and shared-cache gating; this is construction work, not a per-request policy instantiation.
Custom-policy bindings retain the caller's typed worker role and display name. Tests inject public picker/filter policies instead of fake router selector types. Scheduler error mapping continues to cover overload behavior separately from policy filtering.
Host boundary
SelectionHostgroups existing inputs without moving runtime transport into the core. Availability and overload remain host inputs because discovery and slot state do not contain every transport or backend health signal. The removed embedded-selection flag was a temporary stack interface; it no longer chooses a second scheduler.#51 makes the cache group's index source explicit. #53 documents and validates the final affinity and request-lifecycle ownership.
Validation
Current stack boundary:
9cb836bccd906ed51d90ab525273fcc7efea2805; the series is based on Dynamo mainab58558c2dff28f4ff1ea4e219030eac5da3f48f.cargo check -p dynamo-kv-router -p dynamo-llm -p dynamo-ext-proc --no-default-features --features dynamo-kv-router/standalone-selection,dynamo-kv-router/standalone-slot-tracker --all-targetsfor this stack boundary.cargo check --manifest-path lib/bindings/python/Cargo.toml --features select-service --all-targetsat this boundary.GitHub CI is not green across this series. Recurring failures are the missing fork Fastchecker runner group, helm-tester image and approval-bot token, plus published-docs composition and an unchanged external documentation link. The local compilation and final-stack validation above are recorded separately from those CI failures.
Stack
idhanani/up-1-host-hooksidhanani/up-2-core-indexingidhanani/up-3-embed-coreidhanani/up-4-delete-kvscheduleridhanani/up-5-policy-sourceidhanani/up-6-membershipidhanani/up-7-kv-index-sourceidhanani/up-8-affinity-tableidhanani/up-9-epp-affinity