feat: implement DumpState for program-aware-fairness#1839
Open
thc1006 wants to merge 1 commit into
Open
Conversation
Expose aggregate fairness health through /debug/plugins/state: the number of tracked programs, total in-flight requests, and Jain's fairness index. Program IDs come from a user-controlled request header, so they are omitted rather than dumped; only these bounded aggregates are reported. Part of llm-d#1755. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
shmuelk
approved these changes
Jun 28, 2026
Author
|
The failing e2e-router (pd) check is the "should report metrics" spec, which is flaky on main at the moment. It fails on the base commit (1fa3803) with the same spec and nothing changed, and this PR only touches the program-aware fairness plugin. Could you re-run that job when you get a chance? |
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.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds
plugin.StateDumperto the program-aware-fairness plugin so its health canbe inspected through
GET /debug/plugins/state, the same way theinflight-load-produceralready exposes its state.Unlike the other plugins, this one keys its state by program ID, which comes from
a user-controlled request header (
x-llm-d-inference-fairness-id) and ishigh-cardinality. Dumping those IDs would expose user-controlled, tenant-identifying
values, which
docs/plugin_debug.mdsays to omit. SoDumpStatereports onlybounded aggregates and no IDs: the number of tracked programs, total in-flight
requests, and Jain's fairness index (which the plugin already computes). That is
the right operational signal for a fairness policy without leaking identities.
Example response for this plugin:
{"totalPrograms":12,"totalInFlight":34,"fairnessIndex":0.92}A shared
jainFairnessIndexhelper keeps the index formula in one place so thedump and the existing metric come from a single snapshot of the program map.
Part of #1755.
Which issue(s) this PR fixes:
Fixes #1798
Release note (write
NONEif no user-facing change):Testing:
New unit tests, all passing: