Repository navigation
refactor(router): selection policy source, SelectionHost, and dead-flag removal - #37
Closed
ishandhanani wants to merge 4 commits into
Closed
ishandhanani wants to merge 4 commits into
ishandhanani wants to merge 4 commits into
Conversation
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]>
ishandhanani
had a problem deploying
to
external_collaborator
September 3, 2026 21:15 — with
GitHub Actions
Failure
Owner
Author
Group A exit gate: router e2e with mockers (this head,
|
| Result | Count |
|---|---|
| passed | 45 |
| skipped | 6 |
| failed, environment only | 5 |
The five failures are build-feature gaps in this environment, not router behavior: test_indexers_sync[nats-etcd], test_indexers_sync[nats-file], and test_router_decisions[zmq_nats_free-tcp] need dynamo.indexer (--features kv-indexer); test_router_decisions_router_aic[tcp] and test_router_decisions_disagg_router_aic need --features aic-forward-pass. Every KV routing, replica-sync, overload (529), session-affinity, and disaggregated test that ran passed on the embedded partition with SelectionPolicySource::Registry.
This was referenced Sep 3, 2026
Closed
Owner
Author
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.
Stack 1, group A, step 3 (last) of the unification DEP (#33, "Stack 1 DEP r2" comment). Stacked on #36.
Summary
API cleanup after the runtime scheduler deletion. Four logical commits:
refactor(router): remove the ignored router_embedded_selection flag— the flag was a no-op after refactor(router): delete the runtime-bound KV router scheduler #36 and never shipped, so it goes fromKvRouterConfig(Rust and serde), theDYN_ROUTER_EMBEDDED_SELECTIONoverride, the Python arg group, the bindings signature, and the frontend configuration reference. No wire shim: no released worker emits it.refactor(router): drop the selector type parameter from the frontend router—KvRouter,RoutingHost,RoutePlan,RequestGuard,PrefillRouter,ManagedKvRouter,ModelWatcher, andPreprocessedRoutinglose<Sel>. Callers pass aSelectionPolicySource(Registry: the linked policy the config names, else Dynamo's default;Factory: an explicitWorkerSelectionPolicyFactory). The router resolves it once and instantiates one policy to learn its worker inputs, so shared-cache and indexer gating are unchanged.ModelManagerconstructors are renamedkv_chooser_for_with_policy[_and_client]/managed_kv_router_for_with_policy; the bindings'custom-policyfeature no longer needs separate router types. The delegating-selector adapter in the embedded backend goes with its only caller.refactor(kv-router): remove the delegated worker-selector adapter—DelegatedWorkerSelector,ErasedWorkerConfig, and theDelegatedpolicy state are deleted from the public selector module.refactor(kv-router): group host-supplied selection inputs into SelectionHost—SelectionHostHooksbecomesSelectionHost { load, cache, eligibility, telemetry, replication }, each group defaulting to standalone behavior; builder methodSelectionServiceBuilder::host. Group C replacescachewith the KV index source; group D extendsreplication.Net: 614 insertions, 1131 deletions across 30 files.
Validation
cargo test -p dynamo-kv-router --features standalone-selection --lib: 1069 passed (selection core tests included).cargo test -p dynamo-llm --lib -- kv_router:: discovery:: entrypoint::: 535 passed.cargo clippy -p dynamo-llm -p dynamo-kv-router --tests: clean. Bindingscargo checkwith and withoutcustom-policy: clean.Review notes (graham-code-review pass)
WorkerSelectortypes now inject picker/filter policies through the public worker-selection API. The old "all workers overloaded" test could not be expressed that way (a policy cannot report overload), so it became "all workers filtered maps to Unavailable"; the overload mapping keeps its directmap_scheduler_errorunit test and the e2e 529 tests.policy_worker_inputs: one extra policy instantiation at router construction (and one more inModelManagerfor shared-cache gating). Factories are cheap builders; not worth a second constructor to avoid.HostTelemetryandHostReplicationare single-field groups today. Kept as structs so the five groups in the DEP map one-to-one onto the type and groups C/D extend them without another rename.