-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ci: Add support for max_inflight_requests parameter to prevent unbounded memory growth in ensemble models
#8458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Add support for max_inflight_requests parameter to prevent unbounded memory growth in ensemble models
#8458
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for a new max_ensemble_inflight_responses parameter to ensemble models for preventing unbounded memory growth in scenarios with decoupled models and slow consumers.
- Implements backpressure mechanism to limit concurrent responses in ensemble pipelines
- Adds comprehensive test coverage including valid/invalid parameter validation
- Creates new test models for decoupled producer and slow consumer scenarios
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| qa/L0_simple_ensemble/test.sh | Adds backpressure testing logic and invalid parameter validation |
| qa/L0_simple_ensemble/models/slow_consumer/config.pbtxt | Configures Python backend model with intentional processing delay |
| qa/L0_simple_ensemble/models/slow_consumer/1/model.py | Implements model that adds 200ms delay per request to simulate slow processing |
| qa/L0_simple_ensemble/models/ensemble_enabled_max_inflight_responses/config.pbtxt | Ensemble configuration with backpressure parameter set to 4 |
| qa/L0_simple_ensemble/models/ensemble_disabled_max_inflight_responses/config.pbtxt | Baseline ensemble configuration without backpressure parameter |
| qa/L0_simple_ensemble/models/decoupled_producer/config.pbtxt | Configures decoupled Python model for multiple response generation |
| qa/L0_simple_ensemble/models/decoupled_producer/1/model.py | Implements decoupled model that produces N responses based on input value |
| qa/L0_simple_ensemble/ensemble_backpressure_test.py | Comprehensive test suite for backpressure functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
qa/L0_simple_ensemble/backpressure_test_models/decoupled_producer/1/model.py
Show resolved
Hide resolved
...imple_ensemble/backpressure_test_models/ensemble_disabled_max_inflight_requests/config.pbtxt
Show resolved
Hide resolved
max_inflight_responses parameter to prevent unbounded memory growth in ensemble models
max_inflight_responses parameter to prevent unbounded memory growth in ensemble modelsmax_inflight_requests parameter to prevent unbounded memory growth in ensemble models
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
|
|
||
| * **Zero overhead when disabled**: If `max_inflight_requests: 0` (default), | ||
| no synchronization overhead is incurred. | ||
| * **Minimal overhead when enabled**: Uses a blocking/wakeup mechanism per ensemble step, where upstream models are paused ("blocked") when the inflight requests limit is reached and resumed ("woken up") as downstream models complete processing them. This synchronization ensures memory usage stays within bounds, though it may increase latency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a note here say that this delay will not cause intermediate inflight requests cancel/timeout internally, but the client should be aware of latency being added, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And in model_config.proto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added note in both places.
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
Co-authored-by: Yingge He <157551214+yinggeh@users.noreply.github.com>
yinggeh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work!
What does the PR do?
This PR adds testing for a new parameter
max_inflight_requests.Added
ensemble_backpressure_test.pywith custom decoupled producer and slow consumer models to validate the new feature.Checklist
<commit_type>: <Title>Commit Type:
Check the conventional commit type
box here and add the label to the github PR.
Related PRs:
triton-inference-server/core#455
triton-inference-server/common#141
Where should the reviewer start?
Test plan:
Caveats:
Background
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)