samples: add OpenVX graph pipelining CPU+GPU sample - #1732
Conversation
8b51ead to
ab8c164
Compare
|
Tested on Radeon RX 9070 XT / Ryzen 9 9950X 16-Core Processor, using TheRock Nightly 10.1.0 2026-08-05:
Both backends pass the checksum-equality test and show speed-up with pipelining. |
ab8c164 to
d1e867e
Compare
|
@daniellegillai thanks for testing. You are right to flag this — even with the new heavy preset (1920×1080, two Box3x3 passes) the CPU backend and HIP backend are essentially tied on the machine I have access to (Radeon 8060S / gfx1151). On my local run the heavy preset gives roughly 71–82 fps for both backends, so HIP does not clearly outrun CPU here either. That matches the explanation in the README: the CPU can beat or tie HIP when the per-frame GPU launch/transfer overhead is large relative to the compute. The heavy preset raises the resolution and adds a second filter pass to increase the compute-per-transfer ratio, but whether HIP pulls ahead still depends on the specific GPU. If you can re-run the updated sample with on the RX 9070 XT and share those numbers, that would confirm whether a discrete GPU shows the expected HIP > CPU ordering. Meanwhile, the sample still demonstrates two useful things on any backend:
I am open to making the heavy preset even heavier (e.g., 4K or three filter passes) if the maintainers prefer a clearer GPU win, but I kept 1920×1080 as the default so the sample remains quick to run in CI. |
4b11c3c to
00322f5
Compare
Add samples/c_samples/pipelining, a self-contained demonstration of the vx_khr_pipelining extension on a mixed CPU+GPU workload. The same vision graph (RGB -> ColorConvert -> ChannelExtract(Y) -> Box3x3 -> U8) is run synchronously with vxProcessGraph (--pipeline 0) and asynchronously with QUEUE_AUTO enqueue/dequeue (--pipeline 1). Both paths report identical per-frame checksums so correctness can be verified, while the pipelined path prints a higher fps to make the performance benefit visible. Also update samples/c_samples/README.md with build/run instructions.
00322f5 to
7f75313
Compare
|
@daniellegillai — thanks again for the review. I pushed an update that should address the CPU-vs-HIP concern and add the comparison tools you were looking for:
I verified the full resolution sweep on a local Radeon 8060S / gfx1151 and on the CPU-only backend. On this machine CPU and HIP are still roughly tied at 4K, but the hybrid sample does show a clean pipelining speed-up:
If you can re-run with on the RX 9070 XT and share the table, that would confirm whether a discrete GPU shows HIP clearly ahead of CPU. Meanwhile the README includes a caveats section documenting the queued-ref ownership issue and behavior we noticed while aligning this with PR #1730. |
|
@simonCatBot Reran on Radeon RX 9070 XT / Ryzen 9 9950X 16-Core Processor, using TheRock Nightly 10.1.0 2026-08-05. Please note the checksums now do NOT match for HIP: HIP pipe has ~22 fps (120 frames @ 3840x2160) but the checksum varies. Over 5 back to back runs, these were the results: CPU sync has ~20 fps (120 frames @ 3840x2160) and consistently returns 126587025716 for checksum aggregate over five runs. CPU pipe has ~22 fps (120 frames @ 3840x2160) and consistently returns 126587025716 for checksum aggregate over five runs. |
… to fix non-deterministic HIP pipe checksums The heavy preset previously chained two GPU Box3x3 nodes through a shared virtual intermediate. In QUEUE_AUTO pipelined mode on the HIP backend this produced slightly different aggregate checksums on every run, while sync and the CPU backend were stable. Replace the heavy graph with a single Gaussian3x3 node. It keeps the preset compute-heavy enough to show pipelining speed-up, and the sync and pipelined paths now produce identical, deterministic checksums on both HIP and CPU backends. The README is updated to describe the new heavy graph and to remove the caveat about sync/pipe checksum differences.
|
@daniellegillai — thank you for the detailed re-run. I reproduced the same non-determinism locally on a Radeon 8060S / gfx1151: heavy pipelined HIP checksums varied across runs, while sync and CPU backend were stable. Root cause: the heavy graph chained two GPU Fix: I changed the Updated graph: I also updated the README: the heavy graph description now shows Local verification (Radeon 8060S / gfx1151, 120 frames @ 3840×2160)
Both backends now show matching, deterministic checksums across multiple runs, and the pipelined path is still faster than sync. Could you re-run the heavy preset on the RX 9070 XT to confirm the checksums are now stable? The updated PR is on commit |
… preset change - Update pipelining --help to describe the heavy preset as Gaussian3x3 instead of the old Box3x3 -> Box3x3 chain. - Remove the misleading compare-mode message that claimed heavy sync/pipe checksum differences were expected. - Fix pipelining_hybrid header comment: the CPU stage is Threshold (U8) -> Box3x3, not a U1 conversion. - README: mention both Box3x3 and Gaussian3x3 as the heavier convolutions.
|
@daniellegillai — I did a fresh pass over both samples and fixed a few stale/inconsistent bits that were left after the heavy preset change:
I also updated the PR body to reflect the current two-sample scope and the latest verification numbers. Fresh verification (HIP, Radeon 8060S / gfx1151)
Pipeline depths 2, 4, and 16, plus custom resolutions, all produce matching checksums. CPU-only backend also passes Current tip is |
|
Also updated the PR description itself to reflect the current two-sample scope, the Gaussian3x3 heavy preset, 4K default, and the latest verification tables. The stale 640×480 single-sample text is replaced. |
These GDF files demonstrate the proposed GDF syntax for vx_khr_pipelining support in runvx. They are not executable today because runvx does not yet implement QUEUE_AUTO, graph parameters, or enqueue/dequeue primitives. Files: - utilities/runvx/gdf/pipelining/README.md - utilities/runvx/gdf/pipelining/pipelining_box3x3.gdf - utilities/runvx/gdf/pipelining/pipelining_gaussian3x3.gdf - utilities/runvx/gdf/pipelining/pipelining_hybrid.gdf See ROCm#1734 for the enhancement request.
Summary
Adds two new C++ samples under
samples/c_samplesthat demonstrate the OpenVXvx_khr_pipeliningextension.pipelining— a mixed CPU+GPU vision graph run both synchronously (--pipeline 0) and withQUEUE_AUTOpipelining (--pipeline 1).pipelining_hybrid— a three-stage graph with explicit CPU/GPU/CPU pinning to make the cross-target hand-off explicit.Both samples compute an aggregate checksum so correctness can be verified, and both report fps so the pipelining speed-up is immediately visible.
Graphs
pipelining:RGB -> ColorConvert -> ChannelExtract(Y) -> Gaussian3x3 -> U8RGB -> ColorConvert -> ChannelExtract(Y) -> Box3x3 -> U8pipelining_hybrid:ColorConvert,ChannelExtract(Y)Box3x3 -> Box3x3 -> Box3x3Threshold,Box3x3What was added
samples/c_samples/pipelining/pipelining.cppsamples/c_samples/pipelining/CMakeLists.txtsamples/c_samples/pipelining_hybrid/pipelining_hybrid.cppsamples/c_samples/pipelining_hybrid/CMakeLists.txtsamples/c_samples/README.mdWhy Gaussian3x3 for the heavy preset
The original heavy preset chained two GPU
Box3x3nodes through a shared virtual intermediate. On the HIP backend this produced non-deterministic aggregate checksums inQUEUE_AUTOpipelined mode, while sync and the CPU backend were stable. Replacing the chain with a singleGaussian3x3node removes the shared intermediate and keeps the heavy preset deterministic and bit-exact between sync and pipe on both backends.Verification performed
Built and tested locally on a Radeon 8060S / gfx1151 (HIP) and on the CPU-only backend:
pipelining— HIP backendpipelining— CPU-only backendpipelining_hybrid— HIP backendMultiple back-to-back runs on each configuration produced identical checksums.
Checklist
--compareshows matching checksums for sync and pipe on both backends.--pipeline 1reports higher fps than--pipeline 0.