Repository navigation
feat(kv-router): LoRA-aware candidate narrowing in SelectionService - #10
Closed
ishandhanani wants to merge 1 commit into
Closed
ishandhanani wants to merge 1 commit into
ishandhanani wants to merge 1 commit into
Conversation
Port the frontend KvRouter's narrow_allowed_by_lora into a runtime-free LoraWorkerFilter trait plus a pure narrow_allowed_worker_ids_by_lora helper in lib/kv-router/src/scheduling, and apply it in SelectionCore::schedule_selection through a new SelectionHostHooks::lora_worker_filter hook. Semantics match the frontend exactly: the universe is the caller's allowed_worker_ids (else every schedulable worker in the partition), the filter never widens it, a pinned worker inside the universe survives the filter, and an empty narrowing falls back to the caller's set. Without an injected filter behavior is unchanged. The frontend's LoraFilter implements the trait in the Phase 1 re-host. Tests: pure helper matrix in lora_filter.rs; core test proves the injected filter steers selection, respects allow-sets, and retains pins. Signed-off-by: Ishan Dhanani <[email protected]>
ishandhanani
had a problem deploying
to
external_collaborator
September 3, 2026 06:22 — with
GitHub Actions
Failure
This was referenced Sep 3, 2026
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.
Phase 0 (selection-core parity), item 2b. Stacked on #9.
Summary
scheduling/lora_filter.rs:LoraWorkerFiltertrait (host-owned "which workers can serve adapter X") and a purenarrow_allowed_worker_ids_by_lorahelper that is a line-for-line port ofKvRouter::narrow_allowed_by_lora(lib/llm/src/kv_router.rs:1216-1251): never widens the caller'sallowed_worker_ids, retains an in-universe pin even if the filter dropped it, and falls back to the caller's set when the narrowing is empty.SelectionHostHooks::lora_worker_filter: Option<Arc<dyn LoraWorkerFilter>>;schedule_selectionapplies it before building theScheduleRequest. The universe when no allow-set is given is the partition's schedulable workers (newWorkerCatalog::schedulable_worker_ids_for_key, avoids cloning configs).dynamo_kv_router::LoraWorkerFiltersolib/llm'sLoraFiltercan implement it during the Phase 1 re-host; the frontend can then call the same helper and delete its private copy.Validation
cargo test -p dynamo-kv-router --features standalone-selection --lib -- services::selection scheduling::lora_filter: 73 passed (4 new pure-helper tests, 1 new core test covering LoRA steering, allow-set preservation, pin retention).cargo clippy -p dynamo-kv-router --all-targetswith and withoutstandalone-selection: only the pre-existingregistry.rsdead-code warning.cargo check -p dynamo-llm: clean (new crate-root export does not collide).