Skip to content

Graph pool rebase 2026#3999

Draft
atobiszei wants to merge 13 commits intomainfrom
atobisze_check_graph_pool_2026
Draft

Graph pool rebase 2026#3999
atobiszei wants to merge 13 commits intomainfrom
atobisze_check_graph_pool_2026

Conversation

@atobiszei
Copy link
Collaborator

@atobiszei atobiszei commented Feb 20, 2026

The graph queue pre-initializes a pool of MediaPipe graph instances that are reused across requests, avoiding the overhead of creating and destroying graphs per request. Queue size is resolved during graph validation.

Decision logic (in priority order)
Explicit pbtxt directive — Add a comment in the graph .pbtxt file:

  • # OVMS_GRAPH_QUEUE_SIZE: AUTO — pool sized to std::thread::hardware_concurrency()
  • # OVMS_GRAPH_QUEUE_SIZE: <N> — pool of exactly N graphs (must be ≤ hardware threads)
  • # OVMS_GRAPH_QUEUE_SIZE: 0 or # OVMS_GRAPH_QUEUE_SIZE: -1 — explicitly disable pool

This directive is always honored, regardless of env var or calculator type.
Environment variable OVMS_GRAPH_QUEUE_OFF=1 — Suppresses the auto-enable default. Does not override an explicit pbtxt directive.

If there is no comment in pbtxt file nor environment variable set then graph pool is enabled by default.

Python calculator — If the graph contains PythonExecutorCalculator, the pool is automatically disabled (not yet safe for reuse).

Default — If none of the above apply, the pool is enabled with AUTO sizing.

Revert "Check"

This reverts commit dddaf1b.

Check graph pool

TODO:
-> this requires additional patch in MP to reset initialized_ flag in
CalculatorGraph and verify if that works. Previous MP tests with reruns
worked due to using AddVectorSink which changes the underlying graph and
does not use OutputStreamPollers. Need to verify if change in MP will
enable graph pool or we need to go back to thread pool.

Rebase

POC MP FW test

POC part 2

WIP to stash
@atobiszei atobiszei force-pushed the atobisze_check_graph_pool_2026 branch from a4a8f32 to bb24c5c Compare February 23, 2026 10:04
@atobiszei atobiszei force-pushed the atobisze_check_graph_pool_2026 branch 3 times, most recently from 525c8d8 to 79f91f3 Compare February 23, 2026 14:53
@atobiszei atobiszei force-pushed the atobisze_check_graph_pool_2026 branch from 79f91f3 to 002dc9b Compare February 24, 2026 12:33
@atobiszei atobiszei force-pushed the atobisze_check_graph_pool_2026 branch from 0c50e49 to f895c20 Compare March 9, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant