Skip to content

feat: add priority based holdback strategies in flow control#1592

Merged
liu-cong merged 8 commits into
llm-d:mainfrom
loicmarchal:feature/progressive-holdback
Jul 11, 2026
Merged

feat: add priority based holdback strategies in flow control#1592
liu-cong merged 8 commits into
llm-d:mainfrom
loicmarchal:feature/progressive-holdback

Conversation

@loicmarchal

@loicmarchal loicmarchal commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
Add progressive holdback based on priorities.

It implements the priority-holdback-policy plugin (flowcontrol.UsageLimitPolicy), which computes differentiated admission ceilings per priority level. Lower-priority traffic is gated at lower saturation thresholds, reserving capacity for higher-priority work as the pool approaches saturation.

It replaces the default static usage limit policy's binary backpressure approach with priority-aware stepped gating.

Two gating strategies are supported:

  • stepwise-spread: equal ceiling spacing by rank, ignoring numerical priority values.
    $$c_i = c_{max} - i \times \frac{c_{max} - c_{min}}{N - 1}$$
  • linear-proportional: ceiling spacing proportional to numerical priority differences.
    $$c_i = c_{min} + r_i \times (c_{max} - c_{min})$$
    $$r_i = \frac{p_i - p_{min}}{p_{max} - p_{min}}$$

Both are the same linear mapping applied to different input domains (rank vs value). With evenly distributed priorities, they converge.

It's a first implementation for a v1. More strategies could be added to offer more control of the ceilings distribution to the user (e.g. Sigmoid curve instead of linear).

Which issue(s) this PR fixes:
Fixes #1185

Release note (write NONE if no user-facing change):

Add priority-aware stepped gating policy as an alternative to the default binary backpressure approach

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Unsigned commits detected! Please sign your commits.

For instructions on how to set up GPG/SSH signing and verify your commits, please see GitHub Documentation.

@github-actions github-actions Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 11, 2026
@loicmarchal loicmarchal force-pushed the feature/progressive-holdback branch 8 times, most recently from 442afed to d56a6b4 Compare June 12, 2026 13:41
@github-actions github-actions Bot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Jun 12, 2026
@loicmarchal loicmarchal force-pushed the feature/progressive-holdback branch from d56a6b4 to b3a002b Compare June 12, 2026 16:15
@github-actions github-actions Bot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Jun 12, 2026
@LukeAVanDrie

Copy link
Copy Markdown
Contributor

Didn't get around to reviewing this today; sorry @loicmarchal! Will take a look when I am back in office Tuesday. Let's target this for v0.10 if possible and try to land this alongside eviction (which @RishabhSaini has a draft for).

@loicmarchal loicmarchal force-pushed the feature/progressive-holdback branch 2 times, most recently from 58bf51c to 5b5caef Compare June 13, 2026 17:27
@loicmarchal

Copy link
Copy Markdown
Contributor Author

Didn't get around to reviewing this today; sorry @loicmarchal! Will take a look when I am back in office Tuesday. Let's target this for v0.10 if possible and try to land this alongside eviction (which @RishabhSaini has a draft for).

Thank you @LukeAVanDrie. No worries. Sounds good for v0.10

@loicmarchal

Copy link
Copy Markdown
Contributor Author

@LukeAVanDrie I implemented a new plugin in its own package. I hesitated between this approach and making use of the existing usage limit. The way the usage limit policy was implemented uses a function that is simply called in the ComputeLimit function. We could look into making the usage limit more generic and simply return the function associated with the strategy defined in the config. That might require some refactoring, and maybe adapting the doc a little bit. I'll take a look at it.

@loicmarchal loicmarchal force-pushed the feature/progressive-holdback branch from 5b5caef to 3efe013 Compare June 15, 2026 16:56
@loicmarchal loicmarchal marked this pull request as ready for review June 15, 2026 16:56
@loicmarchal loicmarchal force-pushed the feature/progressive-holdback branch from c375020 to 4b2d595 Compare June 25, 2026 22:11
@loicmarchal

Copy link
Copy Markdown
Contributor Author

I'd recommend two orthogonal fields instead:

I agree. That was a main argument in my comment

My proposal:

parameters:
    shape: linear      # optional, default: linear   (future: sigmoid) => clarify in the doc we currently only support linear
    domain: rank       # optional, default: rank     (rank | value)
    minCeiling: 0.4    # required
    maxCeiling: 0.9    # optional, default: 1.0

This way, we are future-proof for sigmoid, exponential, step, etc. At the same time, if we stay as it is, nothing will break.

If ok with you, I'll implement that change, then maybe we can merge and add sigmoid (or others) as a future implementation?

@loicmarchal loicmarchal force-pushed the feature/progressive-holdback branch 2 times, most recently from 2a1c6a6 to afb9b3f Compare June 26, 2026 23:23
@loicmarchal

Copy link
Copy Markdown
Contributor Author

Thank you for your review @LukeAVanDrie. I changed the config.

LukeAVanDrie
LukeAVanDrie previously approved these changes Jun 29, 2026

@LukeAVanDrie LukeAVanDrie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thanks @loicmarchal!

@loicmarchal loicmarchal force-pushed the feature/progressive-holdback branch from afb9b3f to ecc544e Compare July 7, 2026 16:55
@loicmarchal

Copy link
Copy Markdown
Contributor Author

@ahg-g @liu-cong does it look ok for you? Can it be merged?

@lioraron

lioraron commented Jul 9, 2026

Copy link
Copy Markdown

@ahg-g @liu-cong @elevran @shmuelk This PR is critical for batch-gateway integration with flow-control - #1185 (comment).

Can you please look into merging this?

Thanks.

Signed-off-by: Loic Marchal <lmarchal@redhat.com>
Signed-off-by: Loic Marchal <lmarchal@redhat.com>
Signed-off-by: Loic Marchal <lmarchal@redhat.com>
Signed-off-by: Loic Marchal <lmarchal@redhat.com>
@loicmarchal loicmarchal force-pushed the feature/progressive-holdback branch from bc04820 to ad84e45 Compare July 10, 2026 23:12
Added copyright notice and license information to priority_holdback.go

Signed-off-by: Cong Liu <conliu@google.com>
Comment thread pkg/epp/framework/plugins/flowcontrol/usagelimits/priorityholdback/config.go Outdated
liu-cong added 2 commits July 10, 2026 16:51
…back/config.go

Signed-off-by: Cong Liu <conliu@google.com>
…back/priority_holdback_test.go

Signed-off-by: Cong Liu <conliu@google.com>
liu-cong
liu-cong previously approved these changes Jul 10, 2026
Comment thread pkg/epp/framework/plugins/flowcontrol/usagelimits/priorityholdback/config.go Outdated
…back/config.go

Signed-off-by: Cong Liu <conliu@google.com>
@liu-cong liu-cong merged commit 30385f8 into llm-d:main Jul 11, 2026
29 checks passed
@loicmarchal loicmarchal deleted the feature/progressive-holdback branch July 11, 2026 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flow Control] Priority-Based Progressive Holdback (Adaptive Capacity Reserves)

4 participants