Repository navigation
refactor(router): delete the runtime-bound KV router scheduler - #36
Closed
ishandhanani wants to merge 1 commit into
Closed
ishandhanani wants to merge 1 commit into
ishandhanani wants to merge 1 commit into
Conversation
The frontend router now always schedules on an embedded selection-service partition. Remove `KvScheduler` (kv_router/scheduler.rs keeps only its runtime-free re-exports), the runtime sequence publisher and its constructors, the direct-ZMQ active-sequence ingress, the two-variant `RouterScheduler` dispatch, and the LoRA load estimator's uncalled scheduler polling. `KvRouter<Sel>` keeps its type parameter for API compatibility (`PhantomData<fn() -> Sel>`). A caller-injected `WorkerSelector<ModelRuntimeConfig>` that is neither the default selector nor a registry `WorkerSelectionPolicy` now runs inside the partition: `WorkerSelectionPolicy::delegated` (new `DelegatedWorkerSelector` trait in dynamo-kv-router) hands the selector the scheduling request and a config-erased view of the eligible workers (`ErasedWorkerConfig`), which the embedded host projects back onto `ModelRuntimeConfig`. The unit tests that inject fake selectors run unchanged on that path. The per-worker `router_worker_registered` gauge is now maintained by the embedded catalog feeder. `router_embedded_selection` is deprecated and ignored; `false` logs a warning. Four sequence-level tests that built the runtime sequences directly are removed; their behavior is covered by the replica-lifecycle and session-affinity e2e tests on the embedded path. Signed-off-by: Ishan Dhanani <[email protected]> (cherry picked from commit 71cea67)
ishandhanani
had a problem deploying
to
external_collaborator
September 3, 2026 20:33 — with
GitHub Actions
Failure
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 2 of the unification DEP (#33, "Stack 1 DEP r2" comment). Stacked on #35.
Summary
One logical change: delete the runtime-bound
KvSchedulernow that the embedded selection partition has parity (#35). The frontend router always schedules on the partition.lib/llm/src/kv_router/scheduler.rskeeps only its runtime-free re-exports;sequence.rsloses the runtime sequence publisher and its constructors; the direct-ZMQ active-sequence ingress (sequence/direct_zmq.rs) and the two-variantRouterSchedulerdispatch macro are gone; the LoRA load estimator's uncalled scheduler polling is removed.KvRouter<Sel>keeps its type parameter for source compatibility (PhantomData<fn() -> Sel>). A caller-injectedWorkerSelector<ModelRuntimeConfig>that is neither the default selector nor a registryWorkerSelectionPolicyruns inside the partition throughWorkerSelectionPolicy::delegated(newDelegatedWorkerSelectortrait andErasedWorkerConfigindynamo-kv-router). The existing fake-selector unit tests run unchanged on that path.router_embedded_selectionis deprecated and ignored;falselogs a warning. Therouter_worker_registeredgauge moves to the embedded catalog feeder.Net: 381 insertions, 2096 deletions. Same change as #31 rebased onto #35; #31 will be closed pointing here.
Validation
cargo test -p dynamo-kv-router --lib: 949 passed.cargo test -p dynamo-llm --lib -- kv_router:: lora::: 465 passed.cargo clippy -p dynamo-llm -p dynamo-kv-router --tests: clean. Bindings cratecargo check: clean.tests/router/test_router_e2e_with_mockers.py -m gpu_0: 25 passed, 3 environment-only failures (kv-indexer / aic features not built); replay byte parity vs main on 4 rows.Review notes (graham-code-review pass)
WorkerSelectionPolicy::delegatedhad been inserted betweennew_with_filtersand its doc comment, so the docs attached to the wrong function.ErasedWorkerConfigmap and then aModelRuntimeConfigmap per selection. Only customSelcallers (tests today) pay it. The next step drops theSelgeneric and this adapter entirely, so it is not optimized here.TypeIdcomparison that decides whether aSelneeds the delegating policy is the same transitional shape and goes with it.