feat(inflightloadproducer): allow configuring output ratio#1731
Conversation
Signed-off-by: mohammadkhan <mohammadkhan@digitalocean.com>
There was a problem hiding this comment.
Pull request overview
Adds a user-configurable outputRatio to the in-flight load producer so output token estimation can be tuned to workload characteristics (while preserving the current 1.5 default when unset), addressing issue #1730.
Changes:
- Introduces
DefaultOutputRatioand aNewSimpleTokenEstimatorWithRatio(...)constructor to parameterize output estimation. - Extends
inflight-load-producerconfig with optionaloutputRatio(validated as non-negative) and wires it into the producer’s token estimator. - Documents the new parameter and adds factory-level tests covering default/custom/zero/negative values.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/epp/framework/plugins/requestcontrol/dataproducer/inflightload/token_estimator.go | Adds a default ratio constant and a ratio-configurable estimator constructor. |
| pkg/epp/framework/plugins/requestcontrol/dataproducer/inflightload/README.md | Documents the new outputRatio parameter and its behavior. |
| pkg/epp/framework/plugins/requestcontrol/dataproducer/inflightload/producer.go | Adds outputRatio to config, validates it, and injects it into the token estimator. |
| pkg/epp/framework/plugins/requestcontrol/dataproducer/inflightload/producer_test.go | Adds tests ensuring outputRatio defaults/overrides/validation behave as intended. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Mohammad Ashar Khan <140482588+asharkhan3101@users.noreply.github.com>
|
Presence of |
Thanks, I agree; this is still valuable to ship, but it is papering over a structural flaw that the tunable slope doesn't cure: output is not proportional to input. Two cheap changes can land in a follow-up:
/approve /lgtm |
Signed-off-by: mohammadkhan <mohammadkhan@digitalocean.com>
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR add a new configurable
outputRatioparameter to inflightloaderproducer defaulting to same 1.5 if unspecified. This allows user to better choose a ratio that represents their traffic pattern for input to output ratio. 1.5x default doesn't work very well for high ISL workload with lot of contexts (200K or above). the estimated output token of 300K is very high in those cases.Allowing it to be configured allows user to choose a value that best matches their workload.
Which issue(s) this PR fixes:
Fixes #1730
Release note (write
NONEif no user-facing change):