Repository navigation
feat(router): ship opt-in soft affinity load guard - #15193
Closed
JasperChan929 wants to merge 1 commit into
Closed
JasperChan929 wants to merge 1 commit into
JasperChan929 wants to merge 1 commit into
Conversation
Retain an eligible soft-affinity target until it exceeds a configured active-request limit and another worker has a sufficient load advantage. Register the policy in the shipped catalog and document its YAML configuration. Signed-off-by: WENZHI CHEN (SII) <wc3042@nyu.edu>
JasperChan929
deployed
to
external_collaborator
September 22, 2026 23:15 — with
GitHub Actions
Active
JasperChan929
deployed
to
external_collaborator
September 22, 2026 23:15 — with
GitHub Actions
Active
Contributor
|
👋 Hi JasperChan929! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
This branch was successfully 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
Ship an opt-in soft session-affinity worker-selection policy in the built-in catalog. When a parent-group binding has an eligible target, the policy keeps that worker until its active-request count exceeds
max_active_requestsand another eligible worker is lower by at leastmove_margin. Dynamo's existing affinity coordinator continues to own and update the binding; this PR adds no parent-key logic or router CLI flag.For example, with
max_active_requests: 7andmove_margin: 2, source/alternative loads of 7/0 and 8/7 retain the source, while 8/6 selects the alternative. The shipped defaults are 32/2. The policy is selected through existing router-policy YAML.The existing
soft-pin-repinexample requires a custom catalog build and moves once the threshold is crossed even when the alternative is equally or more loaded. This proposal makes the guarded behavior available in a stock build. It is separate from #15139's binary retain/ignore soft-target switch and #14596's generic two-tier cache/load weights.Validation
cargo test --locked -p dynamo-custom-policy-builtin: 11 passed.cargo clippy --locked -p dynamo-custom-policy-builtin --all-targets -- -D warnings: passed.cargo fmt --all -- --checkandgit diff --check: passed.Limits and next validation
This is a draft capability PR, not a measured speedup. Active-request count is a coarse load proxy; the policy does not know hotspot duration or cache residency. Unbound requests choose the least-loaded eligible worker without consulting cache overlap. Historical GPU measurements motivate the question but used an earlier router revision.
Before requesting merge, compare this policy on current main against hard affinity, two-tier with its existing tunable thresholds, and applicable soft-affinity configuration. Use equal capacity, two physical GPUs, balanced source/order, short and sustained hotspots, plus explicit stay/move controls. Report group-max TTFT, request latency, cached/computed tokens, placement, background impact, and failures. Keep unfavorable valid samples and stop if existing configuration already covers the workload or this policy regresses short hotspots.
Where should the reviewer start?
Review
lib/router-plugins/builtin/src/soft_affinity_load_guard.rsfor the threshold and margin decisions, thenlib/router-plugins/builtin/src/lib.rsfor registration and YAML resolution.Related issues
Relates to #14536. Builds on merged #14521.