Implement OpenVX streaming extension#69
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Implements the OpenVX graph streaming extension by adding per-node pipeup/steady state tracking and a background worker thread to run vxProcessGraph repeatedly, aligning behavior with the GraphStreaming conformance expectations.
Changes:
- Added streaming state fields to internal kernel/node/graph structures and enabled pipelining header inclusion when streaming is enabled.
- Implemented
vxEnableGraphStreaming,vxStartGraphStreaming, andvxStopGraphStreamingusing a worker thread. - Updated graph execution to support pipeup warm-up/steady iteration behavior and to tolerate user kernels without validators.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| sample/include/vx_internal.h | Adds streaming-related fields to internal structs and includes pipelining headers when streaming is enabled. |
| sample/framework/vx_kernel.c | Initializes pipeup depths, adds kernel attribute query/set hooks, and relaxes user-kernel validation requirements. |
| sample/framework/vx_node.c | Initializes and exposes per-node streaming state via VX_NODE_STATE. |
| sample/framework/vx_graph_stream.c | Adds streaming APIs and a background worker thread that repeatedly processes the graph. |
| sample/framework/vx_graph.c | Stops streaming on graph destruction, guards validator calls, derives scalar meta type when needed, and adds pipeup/steady execution logic. |
Comments suppressed due to low confidence (1)
sample/framework/vx_kernel.c:1
addkernelpreviously accepted an explicitvalid_rect_resetargument, but now forcesvalid_rect_resetsolely based onis_user_kernel. That changes semantics: user kernels can no longer opt out ofvalid_rect_reset, and non-user kernels can no longer opt in (if they previously could) via this call path. Suggestion (mandatory): restore a separatevalid_rect_resetparameter (or otherwise preserve the previous behavior) while keeping the relaxed validator requirement for user kernels; also consider adding parentheses around the validator check to avoid precedence ambiguity in future edits.
/*
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds support for vxEnableGraphStreaming, vxStartGraphStreaming and vxStopGraphStreaming to the OpenVX 1.3.2 sample implementation. Implementation details: - Adds streaming state fields to vx_kernel_t, vx_node_t and vx_graph_t. - Supports VX_KERNEL_PIPEUP_OUTPUT_DEPTH / VX_KERNEL_PIPEUP_INPUT_DEPTH kernel attributes and VX_NODE_STATE node queries. - Introduces a background worker thread for streaming that repeatedly calls vxProcessGraph until requested to stop. - For non-streaming vxProcessGraph, performs internal pipeup warm-up iterations while any node is still in pipeup state, then one steady iteration, matching the behaviour expected by the conformance suite. - Skips downstream nodes whose producer is still in pipeup state so that only valid steady-state outputs are consumed. - Resets node execution counters when streaming starts so kernels observe the pipeup-to-steady transition each session. - Allows user kernels without a validate callback (required by the streaming conformance tests) and guards optional validate_input/ validate_output calls during graph verification. - Derives scalar meta type from the actual output object when no output validator is provided. Streaming extension conformance (GraphStreaming.*): 24/24 tests pass.
7370fe2 to
0b944d6
Compare
|
Thanks for the review. I've pushed an update (
Re-verification:
Note: the CLA assistant flag is because the original commit author email ( |
…bs to pass - README.md: list Pipelining and Streaming as supported extensions. Note that Event Queue remains a stub. Update conformance Mode 7/8 notes and CI description to reflect that Streaming is now required to pass. - BUILD_DEFINES: note that Pipelining and Streaming are functional implementations. - .github/workflows/ci.yml: remove continue-on-error from the Streaming job and all other conformance test jobs so the full suite is required to pass. Rename the Streaming job and remove the warning-only echo.
|
Updated README and CI in
Note: the neural-networks job already excludes the |
- .github/workflows/ci.yml:
- Enable Git LFS checkout in both build jobs so large CTS test data
(including AlexNet weights) is pulled.
- Install git-lfs in the runner and add a quick verification step.
- Remove the TensorNetworks.AlexNetTestNetwork exclusion from the
Neural Networks job now that the weights are available via LFS.
- Raise the neural-networks timeout to 1200s to account for the
additional AlexNet test.
- README.md:
- Added a note under the conformance setup section that Git LFS is
required for the cts/test_data/ files.
|
Enabled Git LFS and removed the remaining test exception in
|
Bump KhronosGroup/OpenVX-cts from c550b2c to 2d672f7 (openvx_1.3.2 branch) to pick up the latest conformance test updates including stale-output detection for Laplacian pyramid reconstruct tests and Git LFS documentation. GraphStreaming.* still passes 24/24 locally.
|
Updated the
The CI workflow already has |
… defined (#70) The streaming commit (#69) introduced a while loop guarded by #ifdef OPENVX_USE_STREAMING, with a bare { in the #else path as a drop-in replacement. The } closing the while body was inside the #ifdef block, leaving the bare { in the non-streaming path unclosed. This caused a compile error at end-of-file for any build without -DOPENVX_USE_STREAMING=ON. Co-authored-by: Claude <noreply@anthropic.com>
Summary
This PR implements the OpenVX streaming extension (
vxEnableGraphStreaming,vxStartGraphStreaming,vxStopGraphStreaming) on top of the existing pipelining work in theopenvx_1.3.2branch. It is modelled on the rustVX reference implementation and makes theGraphStreamingconformance tests pass.What changed
sample/include/vx_internal.hvx_kernel_t,vx_node_tandvx_graph_t.vx_khr_pipelining.hwhen either pipelining or streaming is enabled.sample/framework/vx_kernel.cpipeup_output_depth/pipeup_input_depthto1.VX_KERNEL_PIPEUP_OUTPUT_DEPTHandVX_KERNEL_PIPEUP_INPUT_DEPTHin query/set attribute.vxAddUserKernelso aNULLvalidate callback is accepted (required by the streaming conformance tests).sample/framework/vx_node.cexecution_countandnode_state.VX_NODE_STATEquery support.sample/framework/vx_graph.cVX_NODE_STATEtoPIPEUP/STEADYbefore each execution and incrementsexecution_countafterwards.vxProcessGraph, runs internal pipeup warm-up iterations until all nodes reach steady state, then executes one steady iteration, matching rustVX.PIPEUPso only steady outputs are consumed.validate_input/validate_outputcalls during verification so user kernels without validators don't crash.sample/framework/vx_graph_stream.cvxEnableGraphStreaming,vxStartGraphStreamingandvxStopGraphStreamingwith a background worker thread.Verification
GraphStreaming.*: 24/24 tests pass.Graph.VirtualArrayfailure is due to missing test-data images in the local environment).Notes
The implementation intentionally keeps streaming and pipelining orthogonal: streaming builds on the same per-node pipeup-state machinery but does not require the pipelining schedule-mode APIs to be used.