Skip to content

fix(epp): Add check for unpopulated load attributes for TTFT load gate - #2652

Open
d0w wants to merge 4 commits into
llm-d:mainfrom
d0w:ttft-missing-signal
Open

fix(epp): Add check for unpopulated load attributes for TTFT load gate#2652
d0w wants to merge 4 commits into
llm-d:mainfrom
d0w:ttft-missing-signal

Conversation

@d0w

@d0w d0w commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

Previously, with the prefix-cache-affinity-filter, the load gate compared loaded values against defaults that would cause the paths to fail in opposite directions. When endpoints (whether sticky or not) were missing certain attributes such as LatencyPredictionInfo or InFlightLoad.Tokens the substituted value would be arbitrarily 0 or MaxFloat64 causing the gate to unwillingly fire or not fire.

The implementation changes the TTFT and inFlightToken computation functions to return booleans to determine if the computation is ok or not. If not ok (meaning there was no data), the endpoint is excluded from the bestTTFT calculation. If there was no data from either sticky/non-sticky set, then default to the sticky set. When there is missing data causing a failure toward stickiness, a missing_signal count is incremented.

Tests were added as well as an adjustment to the README to note this behavior.

Fixes #2650

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

NONE

@github-actions github-actions Bot added area/epp area/scheduling size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. and removed kind/bug Categorizes issue or PR as related to a bug. labels Sep 1, 2026
@d0w
d0w marked this pull request as ready for review September 1, 2026 21:11
Copilot AI lite review requested due to automatic review settings September 1, 2026 21:11
@d0w
d0w requested review from a team and kaushikmitr as code owners September 1, 2026 21:11
@d0w
d0w requested review from ahg-g and vMaroon September 1, 2026 21:11

Copilot AI 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.

🟡 Changes recommended

There are documentation mismatches/typos in updated helper comments and a metrics test gap that fails to assert the new missing_signal outcome label.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR fixes the prefix-cache-affinity-filter TTFT load gate so it no longer compares observed TTFT values against substituted defaults when endpoints are missing load-related attributes, and it surfaces that “blind” state via a dedicated decision outcome.

Changes:

  • Update TTFT computation helpers to return (value, ok) and exclude endpoints with missing TTFT signals from the best-TTFT calculations.
  • Skip the TTFT load gate and keep the sticky set when either sticky or non-sticky candidates lack the configured TTFT signal, recording a missing_signal decision outcome.
  • Add unit tests and update plugin documentation/README to describe the missing-signal behavior.
File summaries
File Description
pkg/epp/framework/plugins/scheduling/filter/prefixcacheaffinity/README.md Documents updated TTFT load gate behavior when TTFT signals are missing.
pkg/epp/framework/plugins/scheduling/filter/prefixcacheaffinity/plugin.go Implements “missing signal” detection by excluding endpoints without TTFT attributes and skipping the gate when either side is blind.
pkg/epp/framework/plugins/scheduling/filter/prefixcacheaffinity/plugin_test.go Adds tests covering missing-signal behavior for predictor and throughput TTFT sources.
pkg/epp/framework/plugins/scheduling/filter/prefixcacheaffinity/metrics.go Adds the missing_signal decision outcome label.
pkg/epp/framework/plugins/scheduling/filter/prefixcacheaffinity/metrics_test.go Extends decision-outcome metric tests with a missing-signal case (but needs a small fix to assert it).
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

},
}

allOutcomes := []string{outcomeSticky, outcomeNoMatch, outcomeLoadOverride, outcomeExploration, outcomeNotApplicable}
Comment on lines +269 to +273
// endpointTTFT returns the predicted TTFT (ms) for an endpoint, either from the
// latency predictor or estimated from in-flight tokens and peak prefill
// throughput. Endpoints missing the required attribute contribute no signal:
// MaxFloat64 on the predictor path (never the fastest), 0 in-flight tokens on
// the throughput path (no observed load).
func (p *Plugin) endpointTTFT(ep fwksched.Endpoint) float64 {
// the throughput path (no observed load). Returns the ttft and false if predictiond data was missing.
Comment on lines 289 to 290
// inFlightTokens returns an endpoint's in-flight token count, or 0 when the
// attribute is absent (no observed load).
@d0w
d0w force-pushed the ttft-missing-signal branch from 04234e6 to 873ca80 Compare September 1, 2026 21:27
@github-actions

github-actions Bot commented Sep 1, 2026

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.

d0w added 4 commits September 1, 2026 17:28
Signed-off-by: Derek Xu <derxu@redhat.com>
Signed-off-by: Derek Xu <derxu@redhat.com>
Signed-off-by: Derek Xu <derxu@redhat.com>
Signed-off-by: Derek Xu <derxu@redhat.com>
@d0w
d0w force-pushed the ttft-missing-signal branch from 873ca80 to 973f0df Compare September 1, 2026 21:28
@github-actions github-actions Bot added kind/bug Categorizes issue or PR as related to a bug. and removed kind/bug Categorizes issue or PR as related to a bug. labels Sep 1, 2026
@ahg-g

ahg-g commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

/assign @LukeAVanDrie

@d0w d0w changed the title Add check for unpopulated load attributes for TTFT load gate fix(epp): Add check for unpopulated load attributes for TTFT load gate Sep 2, 2026
@github-actions github-actions Bot added kind/bug Categorizes issue or PR as related to a bug. and removed kind/bug Categorizes issue or PR as related to a bug. labels Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/epp area/scheduling kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prefix-cache-affinity-filter: TTFT load gate compares observed values against substituted defaults when an endpoint lacks its load attribute

3 participants