Repository navigation
feat(router): make the two-tier cost function the default KV policy (DYN-5308) - #162
Draft
ishandhanani wants to merge 5 commits into
Draft
ishandhanani wants to merge 5 commits into
ishandhanani wants to merge 5 commits into
Conversation
ishandhanani
had a problem deploying
to
external_collaborator
November 1, 2026 14:52 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
November 1, 2026 15:12 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
November 1, 2026 15:27 — with
GitHub Actions
Failure
ishandhanani
force-pushed
the
idhanani/dyn-5308-two-tier-default
branch
from
November 1, 2026 15:36
ead35f9 to
2bc1b6a
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 1, 2026 15:36 — with
GitHub Actions
Failure
ishandhanani
had a problem deploying
to
external_collaborator
November 1, 2026 17:19 — with
GitHub Actions
Failure
…ai-dynamo#17699) Signed-off-by: jthomson04 <jwillthomson19@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…namo#17700) Signed-off-by: jthomson04 <jwillthomson19@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Add the factory hosts will install to make dynamo-two-tier-cost-fn the default worker-selection policy. It keeps session-affinity targets exclusive and, on plain decode pools and with zero overlap credit (the load-aware preset), declares load-only inputs so those routers still run no KV indexer. Hosts still install the current default. The HTTP frontend logs a startup notice when --router-mode kv runs without a configured worker-selection policy, and the router configuration docs announce the 1.8 change and the dynamo-default-cost-fn opt-out. Part of DYN-5308 Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
The test's frontends subscribe to KV events over NATS, but the mockers published on the runtime default (ZMQ), so the routers never saw the prefix blocks. The test still passed because the previous default broke equal-cost ties at random; the two-tier default breaks them by row order and failed every attempt. Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Hosts now install dynamo-two-tier-cost-fn as the default worker-selection policy for --router-mode kv. The startup notice and router docs now describe the default as current. The frozen frontend selection trace pins the previous cost function so it keeps covering it, and the stale-presence test expects the default pool to report no runtime parameters. Closes DYN-5308 Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
ishandhanani
force-pushed
the
idhanani/dyn-5308-two-tier-default
branch
from
November 2, 2026 04:09
18bc21c to
09ac594
Compare
ishandhanani
had a problem deploying
to
external_collaborator
November 2, 2026 04:09 — with
GitHub Actions
Failure
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.
Summary
Makes the two-tier cost function (
dynamo-two-tier-cost-fn) the default worker-selection policy for--router-mode kv, and logs a startup notice so users know about the change. Closes DYN-5308.lib/router-plugins/builtin/src/two_tier_cost_fn.rs: newdefault_factory()that hosts install as the default. It uses the upstreamsgl-routerthresholds (cache_threshold0.5,balance_abs_threshold32,balance_rel_threshold1.1) and keeps session-affinity targets exclusive, as the previous default did.--load-awarepreset,overlap_score_credit: 0), the default two-tier picker declares onlyWorkerInputs::LOADand selects the worker with the fewest active requests. The host therefore runs no KV indexer or event subscription for those routers, as before. Configureddynamo-two-tier-cost-fninstances are unchanged.lib/llm/src/kv_router/plugins.rs: the installed registry and the fallback registry both use the two-tier default factory.lib/llm/src/entrypoint/input/http.rs: logs aWARNat frontend startup when--router-mode kvruns without a configured worker-selection policy:To opt out, configure an instance of the previous cost function:
Behavior changes for default
--router-mode kvoverlap_score_weight/overlap_score_credit(except0, which turns off the cache tier),router_temperature,prefill_load_scale, and the host, disk, and shared cache weights all tune the previous cost function. Two-tier reads only its three thresholds.PATCH /router_policyreturns 422 for default pools, because two-tier has no runtime parameters.GET /router_policylists them withconfiguration: null.Open items
sgl-routercache_aware_zmqvalues.mainis still1.7.0andrelease/1.7.0is not cut yet. Merge after the cut so this ships in 1.8 as the notice says.Validation
cargo test -p dynamo-custom-policy-builtin: all pass.cargo test -p dynamo-llm --lib: 3920 passed, 0 failed. Two existing tests changed:selection_matches_frozen_frontend_tracenow pinsdynamo_custom_policy_builtin::default_factory(), so the frozen trace keeps covering the additive cost function.kv_chooser_ignores_stale_presencenow asserts that the default pool reports no runtime parameters.