Skip to content

feat(kv-router): advisory select with worker load and busy evaluation - #12

Closed
ishandhanani wants to merge 1 commit into
idhanani/p0-selection-reservation-indexfrom
idhanani/p0-selection-advisory-busy
Closed

ishandhanani wants to merge 1 commit into
idhanani/p0-selection-reservation-indexfrom
idhanani/p0-selection-advisory-busy

Conversation

@ishandhanani

Copy link
Copy Markdown
Owner

Phase 0 (selection-core parity), item 5. Stacked on #11.

Summary

The Phase 3 DisaggCoordinator flow is "D query-only select -> P busy read -> conditional-disagg policy". Today the frontend gets the prefill busy signal from RoutingHost::prefill_worker_busy (lib/llm/src/kv_router/routing_host/kv.rs:232), which is an advisory (select_without_admission) selection followed by AdvisoryWorkerLoad::prefill_load_exceeds, and the decode busy signal from RoutePlanSignals::decode_load_exceeds (routing_host.rs:295) over potential_decode_blocks and the worker's total_kv_blocks. The selection service exposed neither.

  • SelectResponse.potential_decode_blocks: u64 on every response (the scheduler already computes it) and decode_busy: Option<bool> evaluated against the chosen worker's catalog total_kv_blocks at conditional_disagg_decode_busy_threshold (new WorkerCatalog::total_kv_blocks lookup; no load read).
  • SelectRequest.advisory: bool routes through LocalScheduler::select_without_admission: no queue wait, no booking. The response adds worker_load { active_prefill_tokens, prefill_token_capacity, total_kv_blocks, prefill_busy } with prefill_busy at conditional_disagg_prefill_busy_threshold, matching the frontend's peek_prefill_chosen_worker_busy semantics (unset threshold -> absent).
  • Admitted selections are unchanged apart from the two additive response fields. advisory on a booking is a BadRequest (unreachable over HTTP since SelectAndReserveRequest has no such field; defensive).
  • Documented in standalone-selection.md (response fields + "Advisory selection" section).

Validation

  • cargo test -p dynamo-kv-router --features standalone-selection --lib -- services::selection: 73 passed. New: advisory_select_reports_worker_load_and_busy_evaluation (admitted vs advisory, thresholds 0.5/0.0, capacity 1000, verifies no booking side effect) and busy_evaluation_is_absent_without_thresholds_or_capacity.
  • cargo clippy --features standalone-selection --all-targets: only the pre-existing registry.rs dead-code warning. cargo fmt clean. docs_lint.py clean.

Extend the selection response with what a disaggregation coordinator needs to
run the conditional-disagg policy without a separate load read:

- potential_decode_blocks on every response (the scheduler already computes
  it) and decode_busy, evaluated against the chosen worker's catalog
  total_kv_blocks at conditional_disagg_decode_busy_threshold.
- SelectRequest::advisory selects through LocalScheduler::select_without_admission,
  the same path the frontend's prefill_worker_busy probe uses: no queue wait,
  no booking, and the response carries the chosen worker's projected load
  (active_prefill_tokens, prefill_token_capacity, total_kv_blocks) plus
  prefill_busy at conditional_disagg_prefill_busy_threshold.

Admitted selections are unchanged apart from the two additive response
fields. advisory is rejected for bookings.

Tests: advisory and admitted responses with thresholds configured; absence of
busy flags when thresholds or capacity are unknown; advisory does not book.

Signed-off-by: Ishan Dhanani <[email protected]>
@ishandhanani

Copy link
Copy Markdown
Owner Author

Superseded by the upstream-shaped staging stack: continued as #45 (rebased onto ai-dynamo/main, see #33).

This branch had an error being deployed

1 failed deployment
external_collaborator — 97cd626f Deployed Sep 3, 2026 by ishandhanani via ok-to-test #26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation feat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant