Repository navigation
docs(router): add disaggregated custom policy example - #12992
Merged
Merged
Conversation
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Contributor
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
|
ishandhanani
marked this pull request as ready for review
August 11, 2026 02:36
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Contributor
WalkthroughThe change adds a disaggregated custom worker-selection policy, registers it in the example catalog, adds example and contributor documentation, renames related documentation links, and enables link validation for custom-policy example URLs. ChangesCustom routing policy
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
nvda-mesharma
approved these changes
Aug 11, 2026
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
Signed-off-by: Ishan Dhanani <ishandhanani@gmail.com>
PeaBrane
approved these changes
Aug 11, 2026
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.
Adds runnable aggregated and disaggregated worker-selection examples plus a complete custom-policy walkthrough. Teams can now create, register, configure, and link a policy without copying an example algorithm.
Related Issues
Review Start
examples/router/custom-policy-example/disaggregated/src/lib.rsfor policy behavior.docs/fern/pages/developer-guide/advanced-customizations/custom-worker-selection.mdxfor the end-to-end workflow.How This Was Implemented
disaggregated-loadpolicy that scores prefill workers by active prefill tokens and decode workers by projected decode blocks.Walkthrough
Mental model
The policy crate owns scoring and picking. The catalog registers the policy type, and the host binary links that catalog at build time.
flowchart LR P["Policy crate"] --> C["Team catalog"] C --> F["Python frontend"] C --> E["Custom standalone EPP"] F -->|prefill or decode| W["Policy factory"] E -->|select| W W --> S["Scorers"] S --> K["Picker"] K --> R["Dynamo reservation and routing"]Scoring and selection
The frontend supplies
prefillordecodeasworker_type. The disaggregated example uses active prefill tokens for prefill workers and projected decode blocks for decode workers.Standalone EPP supplies
selectbecause it selects from one worker pool. The EPP example selects the aggregatedleast-busyinstance, and custom factories must handleselectexplicitly.Each scorer declares its cache, load, or routing inputs. Dynamo adds all scorer contributions, then the picker returns one valid candidate row.
Boundaries and limitations
Dynamo still owns eligibility, queueing, reservation, accounting, and metrics. The example algorithms demonstrate the extension contract and do not replace Dynamo's built-in cache-aware selector.
Validation
cargo test -p dynamo-custom-policy-example-basic -p dynamo-custom-policy-example-disaggregated -p dynamo-custom-policy-example-catalog -p dynamo-custom-policy-example-eppcargo clippy -p dynamo-custom-policy-example-basic -p dynamo-custom-policy-example-disaggregated -p dynamo-custom-policy-example-catalog -p dynamo-custom-policy-example-epp --all-targets -- -D warningscargo fmt --all -- --checkpre-commit run --files <changed files>fern checkfern docs broken-linkscargo initandcargo addcommands.Summary by CodeRabbit
New Features
Documentation