Repository navigation
feat(kv-router): host-supplied inputs for SelectionService parity with the frontend scheduler - #45
Closed
ishandhanani wants to merge 2 commits into
Closed
ishandhanani wants to merge 2 commits into
ishandhanani wants to merge 2 commits into
Conversation
ishandhanani
had a problem deploying
to
external_collaborator
September 4, 2026 03:18 — with
GitHub Actions
Failure
This was referenced Sep 4, 2026
Closed
ishandhanani
force-pushed
the
idhanani/up-1-host-hooks
branch
from
September 4, 2026 04:00
7c8494b to
6945918
Compare
ishandhanani
had a problem deploying
to
external_collaborator
September 4, 2026 04:00 — with
GitHub Actions
Failure
ishandhanani
added this pull request to stack #54
September 9, 2026 06:20
…h the frontend scheduler First half of bringing the standalone selection core to input parity with the frontend KvRouter so one engine can serve both. - SelectionHostHooks on SelectionServiceBuilder: prefill-load estimator, overloaded-worker exclusion set, hard-availability inclusion set, shared KV cache, and LoRA worker filter, applied to every partition scheduler the core creates. The standalone service leaves them unset, so its behavior is unchanged; an embedding host feeds the same state it passes to KvScheduler. - Shared-cache hits are queried concurrently with the indexer and reach the scorer and custom policies; select requests accept the frontend's structured session_context (parent_session_id, session_final, kv_hints, input_trigger), with the flat session_id kept as the legacy form. - LoRA-aware candidate narrowing as a runtime-free LoraWorkerFilter trait with the frontend's exact semantics: never widens the allow-set, keeps a pinned worker inside it, falls back to the caller's set when narrowing empties it. - selection_id -> partition index so prefill_complete, free_reservation, and add_output_block stop scanning every partition; a lazy sweep drops ids whose booking was released out of band. - Advisory select through select_without_admission (no queue, no booking) with the chosen worker's projected load and prefill_busy / decode_busy against the conditional-disagg thresholds; admitted responses gain the same two fields. Tests: providers steer selection through the core; shared-cache hits and every session field reach the picker; LoRA helper matrix and injected-filter core test; reservation index population, indexed-first ordering, removal, and sweep; advisory and admitted responses with and without thresholds. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/up-1-host-hooks
branch
from
September 9, 2026 18:30
6945918 to
888548e
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
This was referenced Sep 10, 2026
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 1 of 9 implementing ai-dynamo#14310 (one
SelectionCorefor the frontend, the standalone selection service, and the EPP). Base:main.Summary
Adds host-supplied scheduling inputs to
SelectionCoreso the frontend can later embed the same scheduler used by the standalone service. The core gains the frontend's load, eligibility, shared-cache and session inputs without depending ondynamo-runtime.Implementation
SelectionHostHookssupplies the prefill estimator, overload and availability providers, shared KV cache and LoRA filter to each partition.Walkthrough
Inputs and precedence
prepare_selection_inputscombines indexed overlap, optional shared-cache hits, caller constraints and host eligibility before scheduling. A failed shared-cache lookup logs the failure and proceeds without those hits. LoRA narrowing never widens the caller's allow-set; an allowed pin survives, and an empty narrowing falls back to the caller's set.SelectionSessionContextcarriessession_id,parent_session_id,session_finalandinput_trigger. The trigger maps to the current typed selector contract. KV hints are not a field of this structured session object.Reservation lifecycle
Both booking paths populate the selection-ID-to-partition index. Prefill completion, output-block updates and free operations consult it first. Partition scanning remains necessary for bookings received from replica peers. A lazily started sweep removes entries after out-of-band booking release; construction itself does not require a Tokio runtime.
Stack boundary
Hooks default to absent, so existing standalone callers retain their prior inputs. This PR supplies the scheduling interface; frontend embedding follows in #47. The hook fields are regrouped into
SelectionHostin #49, and reservation-owned affinity leases are added in #53.Validation
Current stack boundary:
888548e387e778baa5b3df123af9a1547899ea4e; 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.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