-
Notifications
You must be signed in to change notification settings - Fork 244
Graph pool rebase 2026 #3999
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
Open
atobiszei
wants to merge
15
commits into
main
Choose a base branch
from
atobisze_check_graph_pool_2026
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,825
−419
Open
Graph pool rebase 2026 #3999
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2eabff0
Check
atobiszei 829257b
Add config for queue
atobiszei 5f96c66
Checkpoint - switchable queue
atobiszei 3fb09d9
Checkpoint
atobiszei 0ae35e1
Streaming with queue
atobiszei e61a174
All gtest tests pass
atobiszei 662a8f1
Style fixes
atobiszei 002dc9b
Fix windows
atobiszei 468abd4
Fix windows test
atobiszei ecd8f52
Pool default env variable switch
atobiszei aaa69ef
Merge main
atobiszei f895c20
Pool configure
atobiszei b51a8d4
Rename variable
atobiszei d83d0c0
Cleanup debug logs in tests, remove GTEST_SKIP from InferWithParams, …
atobiszei f34ddda
Review fixes: ObserverHolder const-map pattern, unique_ptr for graph,…
atobiszei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -215,6 +215,48 @@ Nodes in the MediaPipe graphs can reference both the models configured in model_ | |||||
|
|
||||||
| Subconfig file may only contain *model_config_list* section - in the same format as in [models config file](starting_server.md). | ||||||
|
|
||||||
| ### Graph Pool (Pre-initialized Graph Queue) | ||||||
|
|
||||||
| OpenVINO Model Server can pre-initialize a pool of MediaPipe `CalculatorGraph` instances for a graph definition. Graphs in the pool are started once during server initialization and reused across inference requests, eliminating per-request graph initialization and teardown overhead. This is especially beneficial for graphs that involve expensive setup, done in calculators `Open()` method. | ||||||
|
|
||||||
| #### How it works | ||||||
|
|
||||||
| Without graph pool (legacy behavior), each incoming request creates a new `CalculatorGraph`, calls `StartRun()` with side packets, processes the request, then tears down the graph via `CloseAllPacketSources()` and `WaitUntilDone()`. | ||||||
|
|
||||||
| With graph pool enabled, a fixed number of graphs are pre-initialized and kept in a queue. When a request arrives, an idle graph is acquired from the queue. After processing, the graph is returned to the queue for the next request. The graph is never torn down — instead, `WaitUntilIdle()` is called between requests and the internal timestamp is incremented. | ||||||
|
|
||||||
| #### Configuration | ||||||
|
|
||||||
| The graph pool size is controlled via a comment directive in the graph `.pbtxt` file: | ||||||
|
|
||||||
| ``` | ||||||
| # OVMS_GRAPH_QUEUE_SIZE: AUTO | ||||||
| ``` | ||||||
|
|
||||||
| | Value | Behavior | | ||||||
| |:------|:---------| | ||||||
| | `AUTO` | Pool size is set to the number of hardware threads (`std::thread::hardware_concurrency()`), or 16 if detection fails | | ||||||
| | Positive integer (e.g. `4`) | Pool size set to the given value (must not exceed hardware thread count) | | ||||||
| | `0` or `-1` | Graph pool disabled — falls back to per-request graph creation | | ||||||
|
||||||
| | `0` or `-1` | Graph pool disabled — falls back to per-request graph creation | | |
| | `-1` | Graph pool disabled — falls back to per-request graph creation | |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
The line assigning
destination_pathappears to have an entire Bazel build log appended to it, which will make this script syntactically invalid and break model export. Remove the pasted build output and keep the assignment as a valid Python statement (the build log should not be committed into this file).